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

FormattedRelative server & client rendering are different #184

Closed
hank7444 opened this issue Oct 14, 2015 · 2 comments
Closed

FormattedRelative server & client rendering are different #184

hank7444 opened this issue Oct 14, 2015 · 2 comments

Comments

@hank7444
Copy link

I set the locale is ja-JP on server & client side just like the examples,

but server & client still render different result...

Warning: React attempted to reuse markup in a container but the checksum was invalid. 

This generally means that you are using server rendering and the markup generated 
on the server was not what the client was expecting.

 React injected new markup to compensate which works but you have lost many of the benefits 
of server rendering.

 Instead, figure out why the markup being generated is different on the client or server:

 (client) ".c8wu5255a8.3.0.0">in 4 months</span></
 (server) ".c8wu5255a8.3.0.0">4 か月後</span></h3><h3
@okuryu
Copy link
Member

okuryu commented Oct 14, 2015

Could you put a reproducible example?

@ericf
Copy link
Collaborator

ericf commented Oct 14, 2015

This is likely because the locale data isn't being loaded on the client so it's falling back to English.

ericf added a commit to ericf/react-intl that referenced this issue Oct 14, 2015
A common problem people are facing is having some parts of the app,
namely the ones that use <FormattedDate>, <FormattedNumber>, and
<FormattedTime> rendering properly in the locale they set. While
other components like <FormattedMessage>, <FormattedPlural>, and
<FormattedRelative> render in English. This is happening because
the locale data hasn't been loaded and registered with React Intl.

These changes will warn when this situation is encountered and
fallback to rendering everything in the default locale: English.

Fixes formatjs#173
Fixes formatjs#184
longlho added a commit that referenced this issue Apr 27, 2020
longlho pushed a commit that referenced this issue Apr 27, 2020
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v3.6.2...v3.6.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: null <27856297+dependabot-preview[bot]@users.noreply.github.com>
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

No branches or pull requests

3 participants