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

[core] fix(Icon): avoid breaking rules against conditional React hooks #6268

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

fellmann
Copy link
Contributor

Fixes #6267

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Fix conditional hook in Icon component. As the useEffect hook checks for `typeof icon === "string", it won't run anyway in the other cases.

Reviewers should focus on:

It would be great to use a linter rule to check for conditional hooks, but I did not succeed to configure it. Maybe other components are affected as well.

@palantirtech
Copy link
Member

Thanks for your interest in palantir/blueprint, @fellmann! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

thanks @fellmann!

@adidahiya adidahiya changed the title Fix conditional hook in Icon component [core] fix(Icon): avoid breaking rules against conditional React hooks Jul 10, 2023
@adidahiya adidahiya merged commit 5214dac into palantir:develop Jul 10, 2023
@fellmann fellmann deleted the hf/fix-icon-hooks branch July 10, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Icon] Internal React error: Expected static flag was missing
3 participants