Skip to content

Commit

Permalink
update react peerDependencies to support React 18 (#503)
Browse files Browse the repository at this point in the history
* chore: update react peerDependencies to support React 18

* fix: fix keydown scroll in React 18

Co-authored-by: Alex Drimbe <[email protected]>
  • Loading branch information
alexdrimbe and alexpaymoapp authored Apr 1, 2022
1 parent ce17777 commit 2c2a47d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 5 additions & 1 deletion examples/basic-keydown/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class Section extends React.Component{
<div className="container-fluid">
<div className="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul className="nav navbar-nav">
<li> <input onKeyDown={e => {() => console.log("keydown"), scroll.scrollMore(500) }}/>
<li> <input onKeyDown={e => {
console.log("keydown");
scroll.scrollMore(500);
e.stopPropagation();
}}/>
<a onClick={() => scroll.scrollTo(100)}>Scroll To 100!</a>
</li>
</ul>
Expand Down
6 changes: 4 additions & 2 deletions modules/__tests__/scroll-cancellation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ describe('Scroll cancelation', () => {
const distance = 100;

class TestComponent extends React.Component {
handleKeyDown = () => {
handleKeyDown = (e) => {
scroll.scrollMore(distance, { smooth: true, duration });
e.stopPropagation();
}
render() {
return (
Expand Down Expand Up @@ -65,8 +66,9 @@ describe('Scroll cancelation', () => {
const distance = 100;

class TestComponent extends React.Component {
handleKeyDown = () => {
handleKeyDown = (e) => {
scroll.scrollMore(distance, { smooth: true, duration, horizontal: true });
e.stopPropagation();
}
render() {
return (
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"webpack-dev-server": "^2.11.5"
},
"peerDependencies": {
"react": "^15.5.4 || ^16.0.0 || ^17.0.0",
"react-dom": "^15.5.4 || ^16.0.0 || ^17.0.0"
"react": "^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0"
},
"babel": {
"presets": [
Expand Down

0 comments on commit 2c2a47d

Please sign in to comment.