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

React 19 support #267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOMClient from 'react-dom/client';
import Avatar, {
getRandomColor,
ConfigProvider,
Expand Down Expand Up @@ -453,8 +453,8 @@ var mountNode = document.getElementById('container');
// Enable strict mode when supported by react version
var Wrapper = React.StrictMode || 'div';

ReactDOM.render((
ReactDOMClient.createRoot(mountNode).render(
<Wrapper>
<Demo />
</Wrapper>
), mountNode);
);
2 changes: 1 addition & 1 deletion demo/type-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ class TypeTest extends Component {
<Avatar />
</ConfigProvider>
</div>
)
);
}
}
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ interface CreateAvatarOptions {
sources?: SourceConstructor[]
}

export interface ConfigProvider {
export interface ConfigProvider extends React.PropsWithChildren {
/**
* A list of color values as strings from which the getRandomColor picks one at random.
*/
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"peerDependencies": {
"@babel/runtime": ">=7",
"core-js-pure": ">=3",
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"prop-types": "^15.0.0 || ^16.0.0"
},
"devDependencies": {
Expand All @@ -53,7 +53,7 @@
"@babel/preset-env": "^7.7.7",
"@babel/preset-react": "^7.7.4",
"@babel/runtime": "^7.16.0",
"@types/react": "^16.0.0",
"@types/react": "^19.0.8",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"babel-plugin-polyfill-corejs3": "^0.3.0",
Expand All @@ -63,9 +63,9 @@
"eslint-plugin-react": "^7.17.0",
"file-loader": "^5.0.2",
"gh-pages": "^6.1.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"typescript": "^5.4.5",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.7.3",
"webpack": "^5.72.1",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^4.9.2",
Expand Down