I am trying to test Material-UI components on CodeSandbox. And keep getting the error:
TypeError undefined is not an object (evaluating '_context$muiTheme.borderRadius')
What am I doing wrong?
I am trying to test Material-UI components on CodeSandbox. And keep getting the error:
TypeError undefined is not an object (evaluating '_context$muiTheme.borderRadius')
What am I doing wrong?
The solution was to import this elements from Material UI:
import getMuiTheme from 'material-ui/styles/getMuiTheme'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
And wrap the app with them:
render(<MuiThemeProvider muiTheme={getMuiTheme()}><App /></MuiThemeProvider>, document.getElementById('root'));
Without them we are not getting any styles from Material UI and without them Material UI cannot work.
This is the correct implementation: https://codesandbox.io/s/l9v5q2548z