Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade dependences to support react 18.X #58

Merged
merged 11 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = {
collectCoverageFrom: ['**/*.{ts,tsx}'],
modulePathIgnorePatterns: ['lib'],
coveragePathIgnorePatterns: ['node_modules', 'src/index.ts'],
transformIgnorePatterns: [
'node_modules/(?!(@react-native|react-native)|react-native-modal|react-native-fabric|)',
],
transform: {
'^.+\\.js$': require.resolve('react-native/jest/preprocessor.js'),
},
Expand Down
43 changes: 28 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"modal",
"useModal"
],
"version": "0.1.9",
"version": "0.2.0",
"main": "lib/index",
"types": "lib",
"files": [
Expand Down Expand Up @@ -39,34 +39,47 @@
"lint:report": "eslint . --output-file ./eslint_report.json --format json --ext .ts,.js,.tsx | true"
},
"dependencies": {
"react-native-modal": "11.5.6"
"react-native-modal": "13.0.1"
},
"peerDependencies": {
"react": ">=16.8.3",
"react-native": ">=0.59.0"
"react": "*",
"react-native": ">=0.65.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

So, this works for current react native version in pos and upcoming version change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, Tested on my local

},
"devDependencies": {
"@babel/preset-env": "7.12.1",
"@babel/preset-react": "7.12.1",
"@babel/preset-typescript": "7.12.1",
"@babel/core": "7.13.15",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this change for? adding a lot of dependencies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"@babel/helper-string-parser": "7.18.10",
"@babel/plugin-proposal-class-properties": "7.13.0",
"@babel/plugin-proposal-export-default": "7.0.0-beta.32",
"@babel/plugin-proposal-export-default-from": "7.12.13",
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@babel/plugin-syntax-jsx": "7.12.13",
"@babel/plugin-transform-flow-strip-types": "7.16.7",
"@babel/plugin-transform-object-assign": "7.12.13",
"@babel/plugin-transform-react-jsx-self": "7.16.7",
"@babel/plugin-transform-react-jsx-source": "7.16.7",
"@babel/preset-env": "7.13.15",
"@babel/preset-react": "7.13.13",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "7.13.10",
"@types/jest": "26.0.15",
"@types/react": "16.9.50",
"@types/react-native": "0.63.30",
"@types/react-test-renderer": "16.9.3",
"@types/react": "18.2.38",
"@types/react-native": "0.72.7",
"@types/react-test-renderer": "18.0.7",
"@typescript-eslint/eslint-plugin": "4.6.0",
"@typescript-eslint/parser": "4.6.0",
"babel-jest": "26.6.3",
"eslint": "7.12.1",
"eslint-config-prettier": "6.15.0",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "4.2.0",
"husky": "4.3.0",
"jest": "26.6.1",
"jest": "26.6.3",
"prettier": "2.1.2",
"pretty-quick": "3.1.0",
"react": "16.14.0",
"react-native": "0.63.3",
"react-test-renderer": "16.14.0",
"typescript": "4.0.5"
"react": "17.0.2",
"react-native": "0.66.5",
"react-test-renderer": "17.0.2",
"typescript": "4.9.4"
},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const ModalProvider: React.FC<ModalProviderProps> = ({
const showModal = useCallback(
(content: React.ReactNode, options?: Partial<ModalProps>) => {
setContent(content);
optionsRef.current = options;
if (options) optionsRef.current = options;
},
[],
);
Expand Down
2 changes: 1 addition & 1 deletion tests/useModal.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('useModal', () => {
const TestConsumer: React.FC = () => {
const value = useModal();
spy(value);
return null;
return <></>;
};

create(
Expand Down
Loading