Skip to content
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

Add React hooks section to code style guide #3000

Merged
merged 1 commit into from May 13, 2019

Conversation

AWolf81
Copy link
Contributor

@AWolf81 AWolf81 commented May 10, 2019

Description

As mentioned in the issue I'd like to add a usage info for React Hooks.

I've copied the discussion part from the issue to the PR (see below)

Issue fixed

#2999

Type of changes

  • ⚪ Bug fix (Change that fixed an issue)
  • ⚪ Breaking change (Change that can cause existing functionality to change)
  • ⚪ Improvement (Change that improves the code. Maybe performance or development improvement)
  • ⚪ Feature (Change that adds new functionality)
  • 🔘 Documentation change (Change that modifies documentation. Maybe typo fixes)

Checklist:

  • ⚪ My code follows the project code style
  • ⚪ I have written test for my code and it has been tested
  • ⚪ All existing tests have been passed
  • ⚪ I have attached a screenshot/video to visualize my change if possible

Discussion

  • Do we need a special heading to the copy? Right now I would add React Hooks as heading.
  • My personal opinion is that I would use hooks if it improves reusability e.g. a useResize would be easier to read / understand than a listener for resize event in the constructor or componentDidMount of a class based component. Both implementations are OK and I'm not seeing it as a must have to use hooks - I would prefer class-based components. What is your opinion? Recommend to continue to use class-based components or always use hooks or use both as I'd recommend?
  • I'm not sure about the point with mixing functional and class-based with-in a feature (2nd last sentence in the copy) - maybe that's also OK to use. What do you think? Maybe I have to create an example to see if it's also OK.
  • Anything else to add to the copy?

Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@ZeroX-DG ZeroX-DG added approved 👍 Pull request has been approved by sufficient reviewers. needs extra review 🔎 Pull request requires review from an additional reviewer. labels May 10, 2019
@ZeroX-DG ZeroX-DG requested a review from Rokt33r May 10, 2019 23:35
@Rokt33r Rokt33r merged commit 1601292 into BoostIO:master May 13, 2019
@Rokt33r Rokt33r removed needs extra review 🔎 Pull request requires review from an additional reviewer. approved 👍 Pull request has been approved by sufficient reviewers. labels May 13, 2019
@Rokt33r Rokt33r added this to the v0.11.15 milestone May 13, 2019
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.

None yet

3 participants