daybrush/css-styled

Undefined version cause crash in non-react apps

jvnm-dev opened this issue · 2 comments

The following commit cause an issue in project using this library:
ac6a2b3

Line that causes the issue:
ac6a2b3#diff-0e825ed2f2470d57c43b731b2eea9bbf05aef8e9d1e091b017b56ecd094609eaR22

My situation: I am using the library moveable in a non-react app.
Since there is no react version, its value is undefined so it crashes when doing .indexOf (cannot read indexOf of undefined)

@daybrush Could you check if the version exists before doing the indexOf ? Like:
if ((version ?? '').indexOf("simple") > -1 && portalContainer) {

Thank you

@jvnm-dev

Perhaps it is a dependency problem.

The version of react-simple-compat needs to be updated, but it seems to be a problem. Would you like to delete the moveable and reinstall it?

Thank you, you solved the issue with your last commit 👍🏻