React-hot-loader: mobx-react no longer able to re-assign `render` method

Created on 15 Jan 2018  路  6Comments  路  Source: gaearon/react-hot-loader

Description

mobx-react is no longer able to re-assign render method.

render is no longer writeable, after this change: https://github.com/gaearon/react-hot-loader/commit/d30164784ee5385502f558c01fc15d5dda371172

mobx-react requires render to be writeable:

https://github.com/mobxjs/mobx-react/blob/daf9bab3fb6cd0d505d485fcb9b73b8627f3016f/src/observer.js#L190

Expected behavior

mobx-react works

Actual behavior

mobx-react fails with Uncaught TypeError: Cannot assign to read only property 'render' of object '#<ProxyComponent>'

Environment

React Hot Loader version:

[email protected]

All 6 comments

Found a related comment: https://github.com/gaearon/react-hot-loader/issues/794#issuecomment-357669768

Feel free to close this if you'd like to track it there.

Will be fixed today. Thank you for a report.

Meanwhile you can downgrade to the beta-13. It does not contain a bug.

Thanks!

For anyone following, I _believe_ you have to manually add/pin "react-stand-in": "4.0.0-beta.13" in your package.json, otherwise even [email protected] will still get beta.14 of react-stand-in, which is where this issue comes from.

Oh :(

Released in beta-15.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesIves picture JamesIves  路  4Comments

rockchalkwushock picture rockchalkwushock  路  3Comments

calvinchankf picture calvinchankf  路  3Comments

mtscout6 picture mtscout6  路  3Comments

reintroducing picture reintroducing  路  4Comments