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

Documentation request: createGetP example using translate HOC? #103

Open
rbarkhouse opened this issue Jul 12, 2018 · 2 comments
Open

Documentation request: createGetP example using translate HOC? #103

rbarkhouse opened this issue Jul 12, 2018 · 2 comments

Comments

@rbarkhouse
Copy link

Hello,

I would like to use createGetP to tweak polyglot options, but it's unclear to me from the documentation how I should use createGetP... would each component have to use this selector instead of using the translate HOC? Is there a way to specify my own 'p' to be used in all components that use translate?

Rick

@guillaumearm
Copy link
Collaborator

Hi Rick,

You right, the documentation is not clear about this point.
I think you should use the same getP (custom or not) in your whole app.

In your case, you cannot use translate enhancer.
You should use your custom getP directly inside a redux mapStateToProps.

Is it interesting for you to have a kind of createTranslate function, or something similar ?

@rbarkhouse
Copy link
Author

Specifically, all I want to do is provide an "onMissingKey" function so that I control the error case of when a key is not found... I'd want to just do this once, globally. I'm happy to not use translate as long as I can see how I'm supposed to do it otherwise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants