bmcmahen/sancho

Cannot read property ref of null

Opened this issue · 2 comments

When using Dialog the page crashes with "Cannot read property ref of null"

React Spring useTransition API has changed https://aleclarson.github.io/react-spring/v9/breaking-changes/#The-ref-prop
Related issue pmndrs/react-spring#990

Seems bug is also in Toasts.tsx (more precisely in the toasted-notes sub-package), Alert/Message.tsx, Overlay.tsx and Positions.tsx.

And apparently, this bug broke my builds in production, despite the fact that the versions of the packages are fixed. I just ran npm install and it broke. Seems react-spring updated code for the already released version.

Therefore, this issue needs to be fixed as soon as possible.

As a fast fix, I forced Sancho to use lower version of react-spring package. Works for me.

Just add this to package.json. Yarn required, or NPM + npm-force-resolutions plugin. See Selective dependency resolutions in Yarn

  "resolutions": {
    "sancho/react-spring": "8.0.27"
  }