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

fix(CheckBox): reduce needless re-rendering of Icon #3773

Merged

Conversation

fivecar
Copy link
Contributor

@fivecar fivecar commented Mar 30, 2023

Motivation

CheckBoxIcon re-renders every time, even if nothing has changed. You can easily see this using a tool like https://github.com/welldone-software/why-did-you-render.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Checked with app

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation using yarn docs-build-api
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

In looking through this function, it seems that the || 24 might not be necessary because the function already provides a default value of 24 for size. But I left it alone in case it's meant to guard against users providing a zero for size (as opposed to an undefined).

@netlify
Copy link

netlify bot commented Mar 30, 2023

Deploy Preview for react-native-elements ready!

Name Link
🔨 Latest commit 6eb66df
🔍 Latest deploy log https://app.netlify.com/sites/react-native-elements/deploys/6480b493b69f7a000846b011
😎 Deploy Preview https://deploy-preview-3773--react-native-elements.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.

@arpitBhalla arpitBhalla changed the title fix (CheckBoxIcon): reduce needless re-rendering of CheckBoxIcon fix(CheckBox): reduce needless re-rendering of Icon Jun 7, 2023
@arpitBhalla arpitBhalla merged commit 3c6eac2 into react-native-elements:next Jun 7, 2023
8 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants