Closed stramel closed 3 years ago
Thanks dude, PR accepted ππ»
hey @stramel I'll talk with you here because your DM on Twitter is closed π please, send me a message, I have some proposal to talk with you that maybe you can have interesting ππ»
Description
Below is a detailed list of the changes:
Swap
SFC
forFC
The reasoning behind this is that
SFC
is marked as deprecated by the React team with the suggestion to useFunctionComponent
/FC
instead. https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30364Update
react
imports to prepare for the new JSX transformWith React v17, the React team, launched a new JSX transform that doesn't require
React
to be imported or in the file. This will also be available in v16.14.0 https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.htmlBased on the above announcement, the React team provides steps to take to swap over to the new JSX transform. The
default
export should no longer be used and use the named exports instead. (NOTE: You can still use the namespace import if you wish) This should make it easier to switch over in the near future.I attempted to retain some of the import styling that I had seen throughout. (ie. Type imports as a separate import)
Update React
Fragment
usagesAs of v16.2.0, Fragments have shorthand syntax available. https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html
I swapped over all usages of
<React.Fragment>
to<>
. NOTE: I used<Fragment>
(imported from the named export, refer to above section) when we were utilizingtheme-ui
'sjsx
pragma.Other minor changes
I noticed a few minor things that I fixed along the way:
eslint-disable
s that were unusedreact/display-name
eslint rule and others were to follow best practice and better work with the FastRefresh HMR)NOTE: I'm happy to revert/address any comments/concerns related to the changes made in this PR.