-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Typescript error: Context is not assignable to type 'string' #1742
Comments
@VasilNikolov I had a similar issue some time ago and one of the answers was that context is really only meant for known values and that there are other fallback mechanisms. I don't think even today that I fully agree with that but I have changed my code accordingly.. |
And what are considered known values? |
Everything specified in your translation file as possible context values. |
Like @stefan-schweiger pointed out, you have to specify all possible values for the context value:
|
Yes, but when you introduce a json store for the translations it again throws the errors. |
🐛 Bug Report
The issue is that we are having the following error when using context in a typescript project.
Type '{ context: "Example"; }' is not assignable to type 'string'.
To Reproduce
A minimal reproducible example.
// Paste your code here
Expected behavior
A clear and concise description of what you expected to happen.
// Paste the expected results here
Your Environment
The text was updated successfully, but these errors were encountered: