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

Layout (sub)components do not respect theme provided by ThemeProvider #35

Open
leonth opened this issue Mar 18, 2017 · 0 comments
Open

Comments

@leonth
Copy link

leonth commented Mar 18, 2017

After following the instructions in the README (setting up ThemeProvider), this does not work:

import * as React from 'react'
import { Layout } from 'react-toolbox/lib/layout/Layout'
import { NavDrawer } from 'react-toolbox/lib/layout/NavDrawer'
import { Panel } from 'react-toolbox/lib/layout/Panel'

export default function({ children }) {
  return (
    <Layout>
      <NavDrawer>[nav here]</NavDrawer>
      <Panel>
        {children}
      </Panel>
    </Layout>
  )
}

However, this works / renders correctly:

import * as React from 'react'
import { Layout } from 'react-toolbox/lib/layout/Layout'
import { NavDrawer } from 'react-toolbox/lib/layout/NavDrawer'
import { Panel } from 'react-toolbox/lib/layout/Panel'
import * as theme from '../react-toolbox/theme'

export default function({ children }) {
  return (
    <Layout theme={theme}>
      <NavDrawer theme={theme}>[nav here]</NavDrawer>
      <Panel theme={theme}>
        {children}
      </Panel>
    </Layout>
  )
}

It seems to only affect Layout components - at least AppBar and Button does not have this issue.

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

No branches or pull requests

1 participant