Skip to content
Discussion options

You must be logged in to vote

This is because ecsstatic doesn't run your entire code - it simply finds interpolated expressions and tries to resolve them using the variables available at the top level. Think of it like a slightly more powerful version of eval().

This means any variable referenced inside ${} must be defined at the top-level. In this case, item comes from the function param, so it can't be evaluated.

To fix this problem, ecsstatic would need to run your entire file (perhaps in a node VM) and then collect the style rules after all expressions are resolved. This is a slow, complicated and problematic process. I was actually looking into this a while ago and one of the problems I ran into is that the Node …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mayank99
Comment options

Answer selected by tomahl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants