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
The context is parsed into a JSON object and functions can not be represented in JSON as far as I know.
I investigated this in #539 a bit (since I would love to have this for React projects) but concluded that this is probably not going to happen because of the JSON requirement.
If you have any ideas on how to implement this without a breaking change, I'm all ears.
Not really - that technique is a bit hacky in the sense that it's basically a workaround for what JSON does not support. Additionally, the evaling of the string to be an actual function again is basically a security exploit waiting to happen and I would not allow this in Fractal source.
Can it be supported that functions will work in the component context object.
module.exports = { context: { comeVariableName: { someFunction: function(param){ return "value"; } } } }
it can work in the same way as normal variables in terms of rendering the value.
Its so we can use the syntax in twig.
The text was updated successfully, but these errors were encountered: