You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Help us to manage our issues by answering the following:
Describe your issue:
It's totally unclear for me how expressions inside { } are evaluated. The documentation says:
All template expressions are “just javascript™️”: <pre>{ JSON.stringify(props) }</pre>
the example above works, but accessing other global variables not. Currently I cannot find a way to get { i18next.t('settings') } evaluated. In the generated code i18next is prefixed with "scope." So why "JSON.stringify" not? Isn't it also globally defined in window?
It would be easier for me as a developer to know in which cases "scope." is prefixed and in which not. And there should be a way (using special syntax maybe) to tell the compiler not to prefix the expressions (Feature Request).
The proper way to render custom global variables in this case would be window.i18next.t('key'). While JSON is a known window/node global object i18next is not and that's why the Riot.js compiler doesn't know where to get this value. I will work on a patch ASAP. Thank you
Help us to manage our issues by answering the following:
It's totally unclear for me how expressions inside { } are evaluated. The documentation says:
the example above works, but accessing other global variables not. Currently I cannot find a way to get { i18next.t('settings') } evaluated. In the generated code i18next is prefixed with "scope." So why "JSON.stringify" not? Isn't it also globally defined in window?
It would be easier for me as a developer to know in which cases "scope." is prefixed and in which not. And there should be a way (using special syntax maybe) to tell the compiler not to prefix the expressions (Feature Request).
https://plnkr.co/edit/IQusfuupsQZueucRqjL8?p=preview
On which browser/OS does the issue appear?
All
Which version of Riot does it affect?
v4.5.0
How would you tag this issue?
The text was updated successfully, but these errors were encountered: