Skip to content

Fix error : AuthorizerProvider should know it can accept childe components#22

Merged
lakhansamani merged 1 commit into
authorizerdev:mainfrom
peter-wd-1:main
May 19, 2022
Merged

Fix error : AuthorizerProvider should know it can accept childe components#22
lakhansamani merged 1 commit into
authorizerdev:mainfrom
peter-wd-1:main

Conversation

@peter-wd-1

@peter-wd-1 peter-wd-1 commented May 19, 2022

Copy link
Copy Markdown
Contributor

Hi @lakhansamani, I just wanted to use the AuthorizerProvider in the same way you did in the example.

I'm using typescript.

        <AuthorizerProvider
          config={{
            authorizerURL: '-,
            redirectURL: '-',
            clientID: '-',
          }}
        >
          <Header />
          <Routes>
            <Route path='/' element={<Home />} />
            <Route path='/about-us' element={<AboutUs />} />
            <Route path='/contact-us' element={<ContactUs />} />
          </Routes>
          <Footer />
        </AuthorizerProvider>

But I only get the error below:

 Type '{ children: Element[]; config: { authorizerURL: string; redirectURL: string; clientID: string; }; }' is not assignable to type 'IntrinsicAttributes & { config: { authorizerURL: string; redirectURL: string; clientID?: string | undefined; }; onStateChangeCallback?: ((stateData: AuthorizerState) => Promise<...>) | undefined; }'.
  Property 'children' does not exist on type 'IntrinsicAttributes & { config: { authorizerURL: string; redirectURL: string; clientID?: string | undefined; }; onStateChangeCallback?: ((stateData: AuthorizerState) => Promise<...>) | undefined; }'.

I could fix this error after I added child type for AuthorizerProvider.

Hopefully this be accepted and merged to main code base if there is no problem. :)
Thank you for all those work for this project. Such a nice project.

@peter-wd-1 peter-wd-1 changed the title Fix error AuthorizerProvider should know it can accept childe components Fix error : AuthorizerProvider should know it can accept childe components May 19, 2022
@lakhansamani lakhansamani merged commit 87a68aa into authorizerdev:main May 19, 2022
@lakhansamani

Copy link
Copy Markdown
Contributor

@peter-wd-1 thank you for the fix, looks good to me.

@lakhansamani

Copy link
Copy Markdown
Contributor

@peter-wd-1 released as part of 0.20.0

@peter-wd-1

Copy link
Copy Markdown
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants