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(react): fix component composition issues #281

Merged
merged 10 commits into from
Oct 11, 2024

Conversation

brionmario
Copy link
Member

@brionmario brionmario commented Oct 10, 2024

Purpose

In this PR:

  1. Removed the usage of defaultProps on functional components and refactored to use ES6 syntax. (See: Warn when Using DefaultProps on Function Components facebook/react#16210)
  2. Fix composition issues due to:
  • Not forwarding refs properly
  • Typing issues when using component prop.

Related Issues

Related PRs

  • N/A

Checklist

  • Figma Board Updated. (Mandatory for Icon and Component PRs. If you don't have access, please ask the core team to update it.)
  • UX/UI review done on the final implementation.
  • Story provided. (Add screenshots)
  • Manual test round performed and verified.
  • Unit tests provided. (Add links if there are any)
  • Documentation provided. (Add links if there are any)

Security checks

@brionmario brionmario changed the base branch from migrate-default-props to main October 10, 2024 09:02
@brionmario brionmario changed the title fix(react): remove deprecated defaultProps fix(react): fix component composition issues Oct 10, 2024
@brionmario brionmario force-pushed the migrate-default-props branch from 9375113 to c180abf Compare October 10, 2024 20:11
/**
* @deprecated Use the {@link CountryFlagProps} instead.
*/
export type CountryFlagsProps = CountryFlagProps;
Copy link
Member Author

@brionmario brionmario Oct 11, 2024

Choose a reason for hiding this comment

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

Deprecation tracker: #285 (comment)

pavinduLakshan
pavinduLakshan previously approved these changes Oct 11, 2024
packages/react/src/components/Accordion/Accordion.tsx Outdated Show resolved Hide resolved
pavinduLakshan
pavinduLakshan previously approved these changes Oct 11, 2024
pavinduLakshan
pavinduLakshan previously approved these changes Oct 11, 2024
@brionmario brionmario merged commit 6a4c3d4 into wso2:main Oct 11, 2024
7 checks passed
@brionmario brionmario added the hacktoberfest-accepted Eligible PRs for Hacktoberfest label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Eligible PRs for Hacktoberfest
Projects
None yet
3 participants