-
Notifications
You must be signed in to change notification settings - Fork 8
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(princing-page): fix hydratation #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For percent formatter too please. You should make the hook generic to pass any formatter maybe?
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
9824e99
to
61a3f79
Compare
61a3f79
to
237d353
Compare
8981ec9
to
aab6723
Compare
2057b30
to
0eb6218
Compare
app/pricing/FormattersComponents.tsx
Outdated
); | ||
|
||
React.useEffect(() => { | ||
setFormatter(new Intl.NumberFormat(undefined, optionsRef.current)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be much more efficient to store value in state because if locale produces the same it will avoid a re-render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how to do that and I don't want to delay the PR. As the efficiency improvement has no value here, I'll ignore it.
e453157
to
8c14012
Compare
app/pricing/FormattersComponents.tsx
Outdated
); | ||
|
||
React.useEffect(() => { | ||
setFormatter(() => new Intl.NumberFormat(undefined, optionsRef.current)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said it's inneficient to set the formatter and not the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Greg: inefficient
- Jeremy: NIT (nitpicking)
- Greg: inefficient
Well, well 🐳
8c14012
to
79fceea
Compare
79fceea
to
50db64f
Compare
No description provided.