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

[v4] Use hooks in components where it's easy #1797

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Jul 9, 2019

WHY are these changes introduced?

Hooks! Hooks! Hooks!

Death to withAppProvider! Death to withAppProvider! Death to withAppProvider!

WHAT is this pull request doing?

Many of our components are already functions, but got wrapped with withAppProvider to provide translations. This PR changes them to use the useI18n hook so we avoid the need for the withAppProvider HoC.

Class components haven't been touched, so we're still using withAppProvider in plenty of places, but this targets the components where this change is easy to make.

How to 🎩

Check everything still gets translations

@BPScott BPScott temporarily deployed to polaris-react-pr-1797 July 9, 2019 01:08 Inactive
@BPScott BPScott temporarily deployed to polaris-react-pr-1797 July 9, 2019 01:11 Inactive
@BPScott BPScott temporarily deployed to polaris-react-pr-1797 July 9, 2019 01:15 Inactive
@AndrewMusgrave AndrewMusgrave added the 🤖Skip Changelog Causes CI to ignore changelog update check. label Jul 9, 2019
Copy link
Member

@AndrewMusgrave AndrewMusgrave left a comment

Choose a reason for hiding this comment

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

Awesome stuff 😍

Use useI18n() hook instead of wrapping in withAppProvider for components
are already functions
@BPScott BPScott temporarily deployed to polaris-react-pr-1797 July 9, 2019 17:43 Inactive
@BPScott BPScott merged commit a5d3f78 into version-4.0.0 Jul 9, 2019
@BPScott BPScott deleted the easy-hooks branch July 9, 2019 18:23
@AndrewMusgrave AndrewMusgrave temporarily deployed to alpha July 9, 2019 21:32 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖Skip Changelog Causes CI to ignore changelog update check.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants