Skip to content

Commit 09d29e7

Browse files
authored
React 19 support (#267)
1 parent c209a81 commit 09d29e7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

demo/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
import React from 'react';
4-
import ReactDOM from 'react-dom';
4+
import ReactDOMClient from 'react-dom/client';
55
import Avatar, {
66
getRandomColor,
77
ConfigProvider,
@@ -453,8 +453,8 @@ var mountNode = document.getElementById('container');
453453
// Enable strict mode when supported by react version
454454
var Wrapper = React.StrictMode || 'div';
455455

456-
ReactDOM.render((
456+
ReactDOMClient.createRoot(mountNode).render(
457457
<Wrapper>
458458
<Demo />
459459
</Wrapper>
460-
), mountNode);
460+
);

demo/type-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ class TypeTest extends Component {
5656
<Avatar />
5757
</ConfigProvider>
5858
</div>
59-
)
59+
);
6060
}
6161
}

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ interface CreateAvatarOptions {
9595
sources?: SourceConstructor[]
9696
}
9797

98-
export interface ConfigProvider {
98+
export interface ConfigProvider extends React.PropsWithChildren {
9999
/**
100100
* A list of color values as strings from which the getRandomColor picks one at random.
101101
*/

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"peerDependencies": {
4343
"@babel/runtime": ">=7",
4444
"core-js-pure": ">=3",
45-
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
45+
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
4646
"prop-types": "^15.0.0 || ^16.0.0"
4747
},
4848
"devDependencies": {
@@ -53,7 +53,7 @@
5353
"@babel/preset-env": "^7.7.7",
5454
"@babel/preset-react": "^7.7.4",
5555
"@babel/runtime": "^7.16.0",
56-
"@types/react": "^16.0.0",
56+
"@types/react": "^19.0.8",
5757
"babel-eslint": "^10.0.3",
5858
"babel-loader": "^8.0.6",
5959
"babel-plugin-polyfill-corejs3": "^0.3.0",
@@ -63,9 +63,9 @@
6363
"eslint-plugin-react": "^7.17.0",
6464
"file-loader": "^5.0.2",
6565
"gh-pages": "^6.1.1",
66-
"react": "^17.0.1",
67-
"react-dom": "^17.0.1",
68-
"typescript": "^5.4.5",
66+
"react": "^19.0.0",
67+
"react-dom": "^19.0.0",
68+
"typescript": "^5.7.3",
6969
"webpack": "^5.72.1",
7070
"webpack-bundle-analyzer": "^3.6.0",
7171
"webpack-cli": "^5.1.4",

0 commit comments

Comments
 (0)