New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass function as property? #12
Comments
Two things here:
|
Oh, i think the answer is here => https://github.com/NeroCor/react-p5-wrapper#usage Where it is defined: p.myCustomRedrawAccordingToNewPropsHandler = function (props) {
if (props.rotation){
rotation = props.rotation * Math.PI / 180;
}
}; and where it is used: <P5Wrapper sketch={sketch} rotation={rotation} /> notice that the name "myCustomRedrawAccordingToNewPropsHandler" is important: in the source code, you need to call that name exactly to get |
@karismatic-megafauna, @sjorsvanheuveln yeah, this is how it works from what I have seen too, I refactored some code in #48 but hoping to also edit this because it is actually implemented in such a way that it polluted the Currently I think I will propose a simple |
Closing due to inactivity. For those viewing this issue in the future, a related PR of interest could be #65 depending how that one develops. |
Can I also pass a function as a property let's say something like this:
I've tried and failed. Is it possible to do this?
The text was updated successfully, but these errors were encountered: