-
Notifications
You must be signed in to change notification settings - Fork 510
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
React 19 support #310
base: master
Are you sure you want to change the base?
React 19 support #310
Conversation
"react": "^19.0.0", | ||
"react-dom": "^19.0.0", | ||
"sinon": "^2.1.0", | ||
"typescript": "^5.7.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added TS to use the new JSX transform
@@ -36,10 +36,10 @@ | |||
"prop-types": "^15.5.8" | |||
}, | |||
"peerDependencies": { | |||
"react": "^0.14.9 || ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" | |||
"react": "^0.14.10 || ^15.7.0 || ^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new JSX transform requires these React versions
@@ -1,24 +1,24 @@ | |||
{ | |||
"name": "react-infinite-scroller", | |||
"version": "1.2.6", | |||
"version": "2.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
major version bump because of min React peer dep versions
package.json
Outdated
"precommit": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx}": [ | ||
"node_modules/.bin/eslint --fix --max-warnings 0", | ||
"src/*.{js,jsx}": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk why dist was being linted
dist/InfiniteScroll.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been compiled by TS. How can we test this?
tsconfig.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a next major, prop-types should be removed and TS should be preferred.
"prettier": "^3.4.2", | ||
"react": "^19.0.0", | ||
"react-dom": "^19.0.0", | ||
"ts-jest": "^29.2.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts-jest to auto transform code for us - direct babel dep removed
"typescript": "^5.7.2" | ||
}, | ||
"engines": { | ||
"node": "> 18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in maintenance until April 2025
@@ -281,6 +282,6 @@ export default class InfiniteScroll extends Component { | |||
: childrenArray.push(this.defaultLoader); | |||
} | |||
} | |||
return React.createElement(element, props, childrenArray); | |||
return <Element {...props}>{childrenArray}</Element>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using JSX syntax
"description": "Infinite scroll component for React in ES6", | ||
"main": "index.js", | ||
"main": "dist/InfiniteScroll.js", | ||
"jsnext:main": "src/InfiniteScroll.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk what jsnext:main
is for
Overview
This PR adds support for React 19. I believe everything is covered. Any more testing / peer reviews would be appreciated 🙏