tldraw / tldraw-v1

A tiny little drawing app. This is the original 2021-2022 version, released under MIT.
https://old.tldraw.com
MIT License
60 stars 36 forks source link

[bug] core-example: the box is not movable in react 16 #40

Closed dkrupenya closed 7 months ago

dkrupenya commented 1 year ago

Here is a codesandbox of tldraw/examples/core-example with React 16.14: https://codesandbox.io/s/confident-ives-b41u4s

 "dependencies": {
    "@tldraw/core": "^1.21.0",
    "@tldraw/vec": "^1.8.0",
    "react": "16.14.0",
    "react-dom": "16.14.0",
    "react-scripts": "4.0.3"
  }

Problem: The box is not movable. onPointerMove, onPointerDown events just don't fire.

Absolutely the same code but with React 17.0.2 - everything works fine:

https://codesandbox.io/s/magical-chaplygin-gxu4nr

"dependencies": {
    "@tldraw/core": "^1.21.0",
    "@tldraw/vec": "^1.8.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-scripts": "4.0.3"
  }

I'm very curious. Any ideas what could be responsible for such behavior?

judicaelandria commented 1 year ago

Hey @dkrupenya , thanks for the feedback! I think this is not an issue with tldraw, we are using the lib use-gesture I think the bug is coming from it, maybe they don't support react 16 anymore

steveruizok commented 7 months ago

Closing this as we won't be addressing a fix for this version. Check https://github.com/tldraw/tldraw for the latest! And please share there if the bug persists.