-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
I'm getting Cannot read property 'create' of undefined and don't know why. I followed the examples and still getting this.
// theme.js
export default {
color: {
primary: '#FF5A5F',
secondary: '#00A699'
}
}// styles.js
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'
import { css, withStyles } from 'react-with-styles'
import MyTheme from './theme'
ThemedStyleSheet.registerTheme(MyTheme)
export { css, withStyles, ThemedStyleSheet }// index.js
import React from 'react'
import PropTypes from 'prop-types'
import { css, withStyles } from './styles'
function MyComponent({ styles }) {
return (
<div>
<a href="/somewhere" {...css(styles.firstLink)}>
A link to somewhere
</a>{' '}
and{' '}
<a href="/somewhere-else" {...css(styles.secondLink)}>
a link to somewhere else
</a>
</div>
)
}
MyComponent.propTypes = {
styles: PropTypes.object.isRequired
}
export default withStyles(({ color }) => ({
firstLink: {
color: color.primary
},
secondLink: {
color: color.secondary
}
}))(MyComponent)If I export like this
export default withStyles()(MyComponent)it works just fine, but I don't have the styles.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels