Skip to content

chore: support React 19 (remove propTypes, update peerDependencies) #1178

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"peerDependencies": {
"expo": ">=48.0.0",
"react": "^16.11.0 || ^17 || ^18",
"react": "^16.11.0 || ^17 || ^18 || ^19",
"react-native": ">=0.65.0 <1.0.x"
},
"peerDependenciesMeta": {
Expand Down
17 changes: 8 additions & 9 deletions src/hooks/auth0-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useEffect, useReducer, useMemo, useCallback } from 'react';
import type { PropsWithChildren } from 'react';
import jwtDecode from 'jwt-decode';
import PropTypes from 'prop-types';
import Auth0Context from './auth0-context';
import Auth0 from '../auth0';
import reducer from './reducer';
Expand Down Expand Up @@ -80,7 +79,14 @@ const Auth0Provider = ({
children,
}: PropsWithChildren<Auth0Options>) => {
const client = useMemo(
() => new Auth0({ domain, clientId, localAuthenticationOptions, timeout, headers }),
() =>
new Auth0({
domain,
clientId,
localAuthenticationOptions,
timeout,
headers,
}),
[domain, clientId, localAuthenticationOptions, timeout]
);
const [state, dispatch] = useReducer(reducer, initialState);
Expand Down Expand Up @@ -438,11 +444,4 @@ const Auth0Provider = ({
);
};

Auth0Provider.propTypes = {
domain: PropTypes.string.isRequired,
clientId: PropTypes.string.isRequired,
children: PropTypes.element.isRequired,
headers: PropTypes.object,
};

export default Auth0Provider;