GithubHelp home page GithubHelp logo

Component destroyed about react HOT 7 CLOSED

p5-wrapper avatar p5-wrapper commented on April 19, 2024 1
Component destroyed

from react.

Comments (7)

Alynva avatar Alynva commented on April 19, 2024 1

AcademiaWired/Traxometro is where I'm working, and I created that issue there because the problem with the <P5Wrapper /> causes effects that block me to continue developing some things. That issue is not the solution to this issue, I referenced this issue here over there, and not that issue here. Do you understand?

I closed that issue because in my case, I know when my component will be destroyed and in this place I put p.noLoop() to stop the p.draw(). But it's doesn't solve the <P5Wrapper />'s unmount problem.

I will look into the other repo that you mentioned as soon as possible. Thanks for you help! :D

from react.

Alynva avatar Alynva commented on April 19, 2024

I tried make an isDead() in my component, pass it to the sketch and check if it's false in the p.draw() with an p.noLoop() in the else. But when my component will be unmounted, the render() it's no longer called, in other words, the <P5Wrapper /> will not receive new props.

Any help until wrapper update?

from react.

abidabdelaziz avatar abidabdelaziz commented on April 19, 2024

When you have a similar issue and the solution is in another language :D.

from react.

Alynva avatar Alynva commented on April 19, 2024

what did you mean?

from react.

abidabdelaziz avatar abidabdelaziz commented on April 19, 2024

It seems like when the issue was closed another discussion was referenced as part of the issue's closing, I dont understand the referenced discussion because its in another language. Thats all : )

As I am trying to tackle this issue I found this repo by @JobLeonard 'https://github.com/JobLeonard/p5-react' in which he addresses the mounting problems.

Im a newbie to both React and P5js so learning both of them at the same time and integrating them is quite the challenge :D.

from react.

Alynva avatar Alynva commented on April 19, 2024

About the @JobLeonard's repo: It seems very good, and solve the unmount problem. But also create the canvas by it's self, and in my case I want draw directly using the context provided from canvas's element. To this propose, I'm using P5js library just to I don't have to worry about frame rate and the draw() loop to update my own canvas.

I think that it can be better, but I didn't find another soluction until now (P5js doesn't provide the context and doesn't draw like I want)

from react.

and-who avatar and-who commented on April 19, 2024

I just released a new Version since Ages 😅
Please check if your Issue got fixed.
If not please reopen this Issue or create a new one.

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.