Giter VIP home page Giter VIP logo

Comments (5)

jamesrweb avatar jamesrweb commented on April 25, 2024 1

A sketch isn't a react component so this won't work.

You could do like the example here which uses an input to update a rotation hook value which is then passed to the sketch defined here. Wouldn't this be the solution you're looking for?

from react.

vennsoh avatar vennsoh commented on April 25, 2024 1

Thanks @jamesrweb Yes! I've figured this out after understanding a bit more how React lift the states up https://reactjs.org/docs/lifting-state-up.html

And p5.myCustomRedrawAccordingToNewPropsHandler is awesome!

Can close this now (:

from react.

yevdyko avatar yevdyko commented on April 25, 2024 1

The actual link for examples is here

from react.

pony0pn avatar pony0pn commented on April 25, 2024

A sketch isn't a react component so this won't work.

You could do like the example here which uses an input to update a rotation hook value which is then passed to the sketch defined here. Wouldn't this be the solution you're looking for?

Unfortunately those links are no longer live, could you share them another way?

I also saw you respond in another issue that you wouldn't implement hooks without a good reason, how about this, making async web3 calls and general web3-react integration within Processing. Currently working on a project that needs this, I think it will become increasingly useful as well!

Thanks so much

EDIT:
Ok I found the new path to the examples you linked and was able to pass in a function from the parent component that calls the hook and that worked!

from react.

jamesrweb avatar jamesrweb commented on April 25, 2024

Updated the links for future references to be in tact. 👍🏻

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.