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

Remove ternary operator in React component #23248

Merged
merged 1 commit into from
Dec 3, 2018
Merged

Remove ternary operator in React component #23248

merged 1 commit into from
Dec 3, 2018

Conversation

ericskao
Copy link
Contributor

@ericskao ericskao commented Oct 19, 2018

Remove ternary operator in React component, unnecessary operator to render null

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • None of my changes are plagiarized from another source without proper attribution.
  • My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.

Closes #XXXXX

@ericskao ericskao requested a review from a team October 19, 2018 17:52
@honmanyau honmanyau self-assigned this Nov 13, 2018
@honmanyau honmanyau closed this Nov 13, 2018
@honmanyau honmanyau reopened this Nov 13, 2018
@honmanyau
Copy link
Member

Closed and re-opened to resolve Travis errors!

@honmanyau honmanyau added the status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. label Nov 13, 2018
@raisedadead raisedadead removed the request for review from a team November 13, 2018 09:44
@honmanyau honmanyau assigned QuincyLarson and unassigned honmanyau Nov 14, 2018
@honmanyau
Copy link
Member

@QuincyLarson I think the refactoring is okay to be merged, but the PR targets a "core" file and we're not sure if we should just merge it! Thank you very much for having a look at this!

@honmanyau honmanyau removed the status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. label Nov 14, 2018
@QuincyLarson QuincyLarson removed their assignment Dec 1, 2018
@QuincyLarson
Copy link
Contributor

@honmanyau Agreed - I'm going to let @Bouncey take a look at it.

Copy link
Member

@cmccormack cmccormack left a comment

Choose a reason for hiding this comment

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

FWIW, this looks fine to me. Render can be either a Boolean or null (source) when you want to render a component conditionally. This is currently a common pattern with React

Remove ternary operator in React component, unnecessary operator to render null
@raisedadead raisedadead added the platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. label Dec 3, 2018
@Bouncey Bouncey merged commit 33ccd41 into freeCodeCamp:master Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: learn UI side of the client application that needs familiarity with React, Gatsby etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants