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

theme props not available for the childs #57

Open
smkamranqadri opened this issue Jan 13, 2020 · 1 comment
Open

theme props not available for the childs #57

smkamranqadri opened this issue Jan 13, 2020 · 1 comment
Labels
question Further information is requested

Comments

@smkamranqadri
Copy link

smkamranqadri commented Jan 13, 2020

I used BootstrapProvider like this

Provider store={this.props.store}>
        <IntlProvider locale={language}>
          <ThemeProvider theme={defaultTheme}>
          <BootstrapProvider>
            <Container>

And not able to get the theme prop in Container Component.

export const Container = styled(div)(
  (props) => {
    console.log('props', props)
    return css`
    height: 100vh;
  `}
);
@kopax
Copy link
Contributor

kopax commented Jan 15, 2020

You don't need ThemeProvider and BootstrapProvider, just use <BootstrapProvider theme={defaultTheme} />.

Also, what is div ? You should have written something like this:

styled.div`
  (props) => {
    console.log('props', props)
    return css`
    height: 100vh;
  `}
`

If div is a component, then you need to not forgot to pass className otherwise, the class can't be applied. This is how styled-components work.

@kopax kopax added the question Further information is requested label Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants