Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Switch to Fragment short syntax (from <Fragment> to <>) #1761

Closed
Aljullu opened this issue Feb 18, 2020 · 2 comments · Fixed by #3536
Closed

Switch to Fragment short syntax (from <Fragment> to <>) #1761

Aljullu opened this issue Feb 18, 2020 · 2 comments · Fixed by #3536
Assignees
Labels
type: cooldown Things that are queued for a cooldown period (assists with planning). type: refactor The issue/PR is related to refactoring.

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Feb 18, 2020

There has been some discussion in a couple of PRs in parallel whether we should use <Fragment> or <>:

This issue is to centralize the discussion and, in case we agree to switch from <Fragment> to <>, enable the appropriate ESLint rule.

Some things to notice:

  • We have been consistently using <Fragment> until now.
  • Gutenberg is inconsistent about this and uses both, <Fragment> and <>.
  • Using <Fragment> means we need to import it. Considering we currently have three different packages where it can be imported from (@wordpress/element, wordpress-element and react), that might be a source of unexpected bugs that could be prevented if we used the short syntax.
  • Fragments in React docs
@Aljullu Aljullu added the type: refactor The issue/PR is related to refactoring. label Feb 18, 2020
@senadir senadir self-assigned this Feb 18, 2020
@nerrad nerrad added the type: cooldown Things that are queued for a cooldown period (assists with planning). label Feb 18, 2020
@nerrad
Copy link
Contributor

nerrad commented Feb 18, 2020

cc @woocommerce/wc-admin - this is a code style/standard change that we should decide on together so we keep the projects align. For the next cooldown period it'd be good to create an eslint package (extending WP linting package) that standardizes around code styles/standards for the project and then we can just submit pulls to that package.

@mikejolley
Copy link
Member

Been using <> in new PRs since learning about it. The convenience of that is a massive ➕ .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: cooldown Things that are queued for a cooldown period (assists with planning). type: refactor The issue/PR is related to refactoring.
Projects
None yet
4 participants