Giter VIP home page Giter VIP logo

Comments (4)

jamesrweb avatar jamesrweb commented on April 27, 2024

Interesting...

We added cleanup effect handlers a while ago as you can see in the ReactP5WrapperWithSketch component.

I'm not sure why this is happening with the strict mode implementation. My only idea at the moment is that there's some effect race issue where the cleanup is done before the ref update. If that's the case then that's a React bug actually. I'm not entirely convinced that is the issue though.

Feel free to create a PR if you already have an idea of what it could be or if you want to take on a challenge? I'm always happy with support from the community. If you aren't able to contribute a PR then I'll take a look myself in the next few days 😁.

from react.

neongreen avatar neongreen commented on April 27, 2024

I am currently in the process of rewriting my code and honestly I might just be using refs/handles very wrongly. I’ll close this issue unless I have a clear repro.

from react.

neongreen avatar neongreen commented on April 27, 2024

Actually no, I gave up on refs entirely and the issue persists. I'll provide a repro.

from react.

neongreen avatar neongreen commented on April 27, 2024

Turns out that extensions are to blame.. although it's still unclear why it might be happening. And it can't be reproduced reliably.

When I enable a bunch of extensions at once, and especially if I also open devtools, I get two canvases perhaps 5 out of 10 times. If I enable a few extensions and don't open devtools — 1/10 times. I couldn't isolate a single extension that would be the culprit, though.

from react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.