-
Notifications
You must be signed in to change notification settings - Fork 144
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
Error: StyleContext.Provider #168
Comments
- import StyleContext from 'isomorphic-style-loader';
+ import StyleContext from 'isomorphic-style-loader/StyleContext'; |
Thanks, but it still doesn't work. (node:86136) UnhandledPromiseRejectionWarning: Error: Cannot find module 'isomorphic-style-loader/StyleContext' |
Sorry, it's my fault, i installed it at version 4.0. |
I get an error : UnhandledPromiseRejectionWarning: Error: Cannot find module 'isomorphic-style-loader/StyleContext'
here is the code:
import React from 'react';
import PropTypes from 'prop-types';
import {Provider} from 'react-redux';
import {ConfigProvider} from 'antd';
// import zhCN from 'antd/es/locale/zh_CN';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import StyleContext from 'isomorphic-style-loader';
import {hot} from 'react-hot-loader/root';
import getStore from './store';
class App extends React.PureComponent {
static propTypes = {
children: PropTypes.element.isRequired,
}
insertCss = (...styles) => {
const removeCss = styles.map(style => style._insertCss())
return () => removeCss.forEach(dispose => dispose())
}
render () {
return (
<StyleContext.Provider value={{insertCss: this.insertCss}}>
{React.Children.only(this.props.children)}
</StyleContext.Provider>
)
}
}
export default hot(App);
The text was updated successfully, but these errors were encountered: