Skip to content

Commit f1120b1

Browse files
committed
Add support for React v18
1 parent c3e02da commit f1120b1

File tree

4 files changed

+53
-52
lines changed

4 files changed

+53
-52
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
- Removed support for depecrated `extraAriaContext` (please use `ariaLabelBuilder` instead)
44

5+
## >= 8.1.3
6+
7+
- Support React 18 (see: https://github.com/AdeleD/react-paginate/issues/423)
8+
59
## >= 8.1.2
610

711
- Excluded unnecessary files from package (see: https://github.com/AdeleD/react-paginate/pull/410)

demo/js/demo.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import PropTypes from 'prop-types';
44
import ReactPaginate from 'react-paginate';
55
import styled from 'styled-components';
@@ -172,7 +172,8 @@ export class App extends Component {
172172
}
173173
}
174174

175-
ReactDOM.render(
176-
<App url={'http://localhost:3000/comments'} author={'adele'} perPage={6} />,
177-
document.getElementById('react-paginate')
175+
const container = document.getElementById('react-paginate');
176+
const root = createRoot(container);
177+
root.render(
178+
<App url={'http://localhost:3000/comments'} author={'adele'} perPage={6} />
178179
);

package-lock.json

Lines changed: 40 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-paginate",
3-
"version": "8.1.2",
3+
"version": "8.1.3",
44
"description": "A ReactJS component that creates a pagination.",
55
"main": "./dist/react-paginate.js",
66
"repository": {
@@ -24,7 +24,7 @@
2424
"prop-types": "^15.6.1"
2525
},
2626
"peerDependencies": {
27-
"react": "^16 || ^17"
27+
"react": "^16 || ^17 || ^18"
2828
},
2929
"devDependencies": {
3030
"@babel/core": "^7.15.8",
@@ -42,8 +42,8 @@
4242
"jest-cli": "^27.3.1",
4343
"jquery": "^3.6.0",
4444
"prettier": "^2.4.1",
45-
"react": "^17.0.2",
46-
"react-dom": "^17.0.2",
45+
"react": "^18",
46+
"react-dom": "^18",
4747
"react-hot-loader": "^4.13.0",
4848
"serve-static": "^1.14.1",
4949
"styled-components": "^5.3.3",

0 commit comments

Comments
 (0)