Skip to content

Rebase#2

Open
sivakumar-cf wants to merge 60 commits intocurefit:masterfrom
faizalshap:master
Open

Rebase#2
sivakumar-cf wants to merge 60 commits intocurefit:masterfrom
faizalshap:master

Conversation

@sivakumar-cf
Copy link
Copy Markdown

No description provided.

Raunak-Agrawal and others added 30 commits February 20, 2020 10:40
Load Android Gradle Plugin conditionally
removed unnecessary buildToolsVersion specification
extracted duplicated default versions extraction from the root project Gradle setup into a function
Fix null object crash.
Log.d internally uses the print method which needs not null value
fix command for adding package with yarn
Removes new NativeEventeEmitter warning on Android
add support latest react-native v0.66
[ENH] remove duplicates from ReadMe
added example
added hook
bumped react native version
Copilot AI review requested due to automatic review settings January 7, 2026 14:32
chore(package.json): remove gradle and idea directories from files
feat: added sim available control and some reject callback for phoneHint
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a major restructuring and modernization of the react-native-otp-verify library. It migrates from a basic TypeScript setup to a comprehensive library structure using react-native-builder-bob, adds proper build configurations, and includes an example application.

Key changes:

  • Modernized TypeScript configuration with stricter compiler options
  • Refactored source code with improved error handling and React hooks support
  • Added comprehensive build tooling (bob builder, release-it, linting)
  • Created example application demonstrating library usage

Reviewed changes

Copilot reviewed 57 out of 79 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tsconfig.json Updated with modern TypeScript compiler options and stricter type checking
tsconfig.build.json New build-specific TypeScript configuration
src/index.tsx Complete rewrite with hooks support, better error handling, and iOS platform checks
src/tests/index.test.tsx Placeholder test file (lacks implementation)
package.json Major update with new build tools, scripts, and dependencies
scripts/bootstrap.js Bootstrap script for development setup
react-native-otp-verify.podspec iOS CocoaPods specification
example/* Complete example application demonstrating library usage
Files not reviewed (2)
  • example/ios/OtpVerifyExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported
  • example/ios/OtpVerifyExample.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1 @@
it.todo('write a test');
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test file only contains a placeholder todo test and lacks any actual test implementation. This means all the functionality added in src/index.tsx (getOtp, startOtpListener, useOtpVerify, getHash, requestHint, addListener, removeListener) has no test coverage.

Copilot uses AI. Check for mistakes.
Comment thread scripts/bootstrap.js
};

if (os.type() === 'Windows_NT') {
options.shell = true
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon at the end of the statement. This is inconsistent with the code style used in the rest of the file where semicolons are present.

Copilot uses AI. Check for mistakes.
Comment thread src/index.tsx
Comment on lines +67 to +77
useEffect(() => {
if (Platform.OS === 'ios') {
console.warn('Not Supported on iOS');
return;
}
getHash().then(setHash);
startOtpListener(handleMessage);
return () => {
removeListener();
};
}, []);
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useEffect hook is missing handleMessage in its dependency array. Since handleMessage is defined inside the component and references numberOfDigits, it should be included in the dependencies, or handleMessage should be wrapped with useCallback to prevent infinite re-renders. Without this, the effect may use stale closures or behave inconsistently.

Copilot uses AI. Check for mistakes.
Comment thread example/src/App.tsx
const [hint, setHint] = React.useState<string>();

// using hook - you can use the startListener and stopListener to manually trigger listeners again.
const { hash, otp, timeoutError, stopListener, startListener } = useOtpVerify();
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable stopListener.

Copilot uses AI. Check for mistakes.
Comment thread example/src/App.tsx
const [hint, setHint] = React.useState<string>();

// using hook - you can use the startListener and stopListener to manually trigger listeners again.
const { hash, otp, timeoutError, stopListener, startListener } = useOtpVerify();
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable startListener.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.