-
Notifications
You must be signed in to change notification settings - Fork 111
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
Support for React 18? #213
Comments
Same issue here :/ |
same issue here |
Yep welp... hasn't been updated to work with React 18... You can see the "peerDependencies": {
"react": ">=16.8.4",
"prop-types": ">=15.5.8",
"oidc-client": ">=1.6.1"
},
Temporary Solution: Extend the import React from 'react';
import { OidcProviderProps } from 'redux-oidc';
import { IApplicationState } from './where/ever/your/redux/store/interface/is/defined';
interface OidcProviderHOC<TState> extends OidcProviderProps<TState> {
children?: React.ReactNode;
} Create a HOC functional component which takes in that interface returning const OidcProviderHOC: React.FC<OidcProviderHOC<IApplicationState>> = (props) => {
return props.children;
};
ReactDOM.render(
<Provider store={store}>
<OidcProviderHOC userManager={userManager} store={store}>
<App />
</OidcProviderHOC>
</Provider>,
document.getElementById('app')
); |
@maxmantz I was going to fix this issue and put out a PR but it looks like it has already been fixed by @ryanzhangau in this commit refactor: add children type to OidcProvder for reactjs 18 export interface OidcProviderProps<TSTate> {
readonly userManager: UserManager;
readonly store: Store<TSTate>;
children?: React.ReactNode;
} It was merged in as well by @drod21 and I do see the change reflected on the master branch: However when pulling the down the latest from npm export interface OidcProviderProps<TSTate> {
readonly userManager: UserManager;
readonly store: Store<TSTate>;
} |
Most projects, you have to publish your libraries to NPM. This library has not been published to NPM in 4 years. |
@ryan-sandy yeah I guess that's what needs to happen @drod21. |
After including the temporary changes as stated above by @jdavis-software jdavis-software , Still the Error exists for me for ! import React from "react"; interface OidcProviderHOC extends OidcProviderProps { const OidcProviderHOC: React.FC<OidcProviderHOC<. RootState> > = (props) => { ReactDOM.render( , However , I did the following changes as temporary changes. interface CallBackProvider extends CallbackComponentProps { const CallBackProviderHOC: React.FC = (props) => { and used as below. <.CallBackProviderHOC <. Spinner/> <./CallBackProviderHOC> |
successCallback is not triggered in. callback component. herez my code. interface CallBackProvider extends CallbackComponentProps { const CallBackProviderHOC: React.FC = (props) => { export function Callback() { return (
); |
Hey, so I created a fork of this library and merged in @drod21 upstream changes. It's compatible with React 18, but since I'm a dinosaur, I didn't test it with TypeScript. If you have issues with TS, open an issue or PR in my fork and I'll update it. You can install my fork using I'll point the |
@ryan-sandy running into a import issue, other than that looking at the code it looks good! node_modules/redux-oidc-2/index.d.ts' is not a module. Here is the import code import { CallbackComponent } from "redux-oidc-2"; Am I missing something with the configuration of it? I am using CRA just FYI |
@jdavis-software Even i am facing the same now after using the new import statement as below import { CallbackComponent } from "redux-oidc-2"; @ryan-sandy this is the error node_modules/redux-oidc-2/index.d.ts' is not a module.ts |
@M1019171 Please head over to redux-oidc-2 and open an issue there. I think in v1.1.1, I've solved the typescript issues. |
The issue @dclayton77 describes is ultimately an issue with React 18 typescript definitions. it seems its not with the actual runtime functioning of this library. React 18's new default definition for functional components does not include children, which is definitely annoying while working with 3rd party libraries like this, but not a deal breaker. This worked for me: root.render(
<Provider store={store}>
{/* @ts-expect-error Official support for React 18 Typescript not yet available */}
<OidcProvider userManager={userManager} store={store}>
<App />
</OidcProvider>
</Provider>,
document.getElementById("root")
); While doing this will irritate your sense of typescript OCD, it gets things working as they were prior to upgrading to react 18. You'll have to do the same thing the |
In another issue @drod21 has mentioned that he got promoted as a maintainer and he has a fork of this repo @ https://github.com/drod21/redux-oidc/ and @ryan-sandy has also mentioned about his fork @ https://github.com/ryan-sandy/redux-oidc. Can this repo point to the forked repo that is more active and will provide support. |
@CarreraPHP I believe this repo is dead. I'm not a maintainer and cannot change what points where. I do not believe anyone has access to the NPM publish side of the repo. |
Raised a new PR 215 for React 18 support along with replacing Webpack & Mocha and all legacy tech except immutable. Yet to test the package in my current application. Package is available in npm as well @ @founding-partner/redux-oidc |
Does this package support React 18? I have upgraded my project but am facing an issue with the registration of the OidcProvider. Using the new root.render syntax, I get the below errors.
I cannot see anything in the documentation about using root.render, only the old syntax. Has anyone else faced/solved this issue?
The text was updated successfully, but these errors were encountered: