leozdgao / react-async-script-loader

A decorator for script lazy loading on react component
MIT License
258 stars 55 forks source link

My componentDidMount() is never invoked #4

Open peebles opened 8 years ago

peebles commented 8 years ago

My render() and my componentWillReceiveProps() are invoked, but my componentDidMount() is never invoked. I am using your composition technique:

export default scriptLoader(
    "/assets/global/plugins/backstretch/jquery.backstretch.min.js"
)(ResetPasswordPage);

Here are the versions of things I am using:

"react": "^15.0.1",
"react-async-script-loader": "^0.2.1",
"react-document-title": "^2.0.1",
"react-dom": "^15.0.1",
"react-router": "^1.0.3",

Using webpack and babel-loader for tooling.

Is this expected behavior? Reading your doc, I would have thought that my componentDidMount() should be called.

leozdgao commented 8 years ago

This is very weird, it's hard to tell without sample code. This life cycle function componentDidMount should be called after component mounted...