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 react fc + pnpm7 #815

Merged
merged 11 commits into from
Jul 26, 2022
Merged

Remove react fc + pnpm7 #815

merged 11 commits into from
Jul 26, 2022

Conversation

poteirard
Copy link
Contributor

  • Remove React.FC in all the code
  • Add eslint rule to avoid adding it again
  • Refactor all the namespace components by following this way as it creates better readability and avoid the use of React.FC
  • Upgraded pnpm to latest
  • Add unused imports rule

Fix #763

Comment on lines +43 to +44
FC: 'See: https://fettblog.eu/typescript-react-why-i-dont-use-react-fc/',
'React.FC': 'See: https://fettblog.eu/typescript-react-why-i-dont-use-react-fc/',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An interesting piece of code

@@ -18,7 +18,7 @@
"downlevelIteration": true,
"noFallthroughCasesInSwitch": true,
"types": ["node", "jest", "@testing-library/jest-dom"],
"incremental": true,
"incremental": false,
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 is set to true as it had false positive with typechecking.

Comment on lines -9 to +10

const ProductTemplate: ProductTemplateStatic & React.FC<ProductTemplateProps> = (props) => (
<ProductTemplateComponent {...props} />
const ProductTemplate = ({ children, ...rest }: ProductTemplateProps) => (
<ProductTemplateComponent {...rest}>{children}</ProductTemplateComponent>
);

ProductTemplate.Card = ProductTemplateCard;

export default ProductTemplate;
export default Object.assign(ProductTemplate, { Card: ProductTemplateCard });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another interesting piece of code

@netlify
Copy link

netlify bot commented Jul 8, 2022

Deploy Preview for zrc ready!

Name Link
🔨 Latest commit d5ee279
🔍 Latest deploy log https://app.netlify.com/sites/zrc/deploys/62dfe423f504ea000911e469
😎 Deploy Preview https://deploy-preview-815--zrc.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@admmasters admmasters left a comment

Choose a reason for hiding this comment

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

Great PR, ❤️ this, do you think it would be possible to break this down into smaller chunks for easier review?

I suppose its all pretty coupled, bar the pnpm one - which could belong in a pr of its own.

@poteirard
Copy link
Contributor Author

Great PR, ❤️ this, do you think it would be possible to break this down into smaller chunks for easier review?

I suppose its all pretty coupled, bar the pnpm one - which could belong in a pr of its own.

Yes, the namespace refactor is to avoid FC. Pnpm change is in a single commit and the eslint imports as well

admmasters
admmasters previously approved these changes Jul 26, 2022
moshie
moshie previously approved these changes Jul 26, 2022
@moshie moshie dismissed stale reviews from admmasters and themself via d5ee279 July 26, 2022 12:54
@moshie moshie self-requested a review July 26, 2022 13:05
@moshie moshie merged commit a786b05 into master Jul 26, 2022
@moshie moshie deleted the remove_react_fc branch July 26, 2022 13:06
@poteirard
Copy link
Contributor Author

🎉 This PR is included in version 5.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@admmasters admmasters changed the title Remove react fc Remove react fc + pnpm 6-7 Jul 28, 2022
@admmasters admmasters changed the title Remove react fc + pnpm 6-7 Remove react fc + pnpm7 Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No longer use React.FC
3 participants