-
Notifications
You must be signed in to change notification settings - Fork 831
Update problematic showcase examples to use hooks #1345
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
Conversation
I would go with using hooks, but the main thing about #1343 was the usage of |
packages/showcase/examples/force-directed-graph/force-directed-example.js
Outdated
Show resolved
Hide resolved
packages/showcase/examples/force-directed-graph/force-directed-graph.js
Outdated
Show resolved
Hide resolved
packages/showcase/examples/responsive-vis/responsive-vis-example.js
Outdated
Show resolved
Hide resolved
setDataSize(e.target.value); | ||
setData( | ||
createData( | ||
~~Math.pow(10, e.target.value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen ~~
being used before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is derived from http://nrabinowitz.github.io/rdv/ and I was just trying to copy as much of his code as I could. I'm not a huge fan of ascii art operators like that, but felt appropriate in keeping with the style of the copied code. shurggie
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it if you feel strongly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it... I just have never seen it before.
I had completely forgotten about the ~arr.indexOf()
to check if the value is included.
No need to change.
This converts the showcase examples listed in #1335 to use hooks. This is slightly in conflict with #1343 which addresses those same examples, although it does so via replacing componentWillRecieve with componentWillUpdate.