Skip to content

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

Merged
merged 2 commits into from
Jun 4, 2020

Conversation

mcnuttandrew
Copy link
Contributor

@mcnuttandrew mcnuttandrew commented May 31, 2020

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.

@Xiot
Copy link
Contributor

Xiot commented Jun 4, 2020

I would go with using hooks, but the main thing about #1343 was the usage of componentWillReceiveProps in the components themselves. Both PRs are still relevant, but yes, there will be some conflict. I'm fine with rebasing my PR to incorporate these changes.

setDataSize(e.target.value);
setData(
createData(
~~Math.pow(10, e.target.value),
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

@mcnuttandrew mcnuttandrew merged commit 881dbe8 into uber:master Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants