sandrinodimattia / use-auth0-hooks

An easy way to sign in with Auth0 in your React application (client-side) using React Hooks
https://nextjs-spa-auth0-demo.now.sh/
MIT License
74 stars 31 forks source link

Can't seem to use provider with typescript #1

Closed jmcbee closed 5 years ago

jmcbee commented 5 years ago
JSX element type 'ReactNode' is not a constructor function for JSX elements.
  Type 'undefined' is not assignable to type 'Element | null'.

And the code:

import {Provider} from 'react-redux'
import {Auth0Provider} from 'use-auth0-hooks'

// ...

return (
    <Auth0Provider
        domain={process.env.AUTH0_DOMAIN as string}
        clientId={process.env.AUTH0_CLIENTID as string}
        redirectUri={process.env.AUTH0_REDIRECTURI as string}
    >
        <Provider store={store}>
            {element}
        </Provider>
    </Auth0Provider>
)
sandrinodimattia commented 5 years ago

Thanks for reporting! Fixed in v0.6.0

jmcbee commented 5 years ago

Can you also fix the onRedirecting type?

sandrinodimattia commented 5 years ago

Added in v0.7.0