callbag-jsx
callbag-jsx copied to clipboard
List of constant values
List
seems to not work with constant values.
reproduction procedure
<List of={["1", "2", "3"]} each={x => <>{x}</>} />
The code above doesn't work and results in an error (in the browser console)
callbag-jsx.v0.1.13.js:230 Uncaught TypeError: src is not a function
at callbag-jsx.v0.1.13.js:230:5
at bind (callbag-jsx.v0.1.13.js:27:7)
at Object.lifeCycleBind (index-4a222ee7.js:108:9)
at render-jsx.dom.v0.2.4.js:636:21
at render-jsx.dom.v0.2.4.js:538:34
at Array.forEach (<anonymous>)
at render-jsx.dom.v0.2.4.js:537:27
at Object.on (index-93332864.js:295:9)
at index.js:82:39
expected behavior
while the code below runs properly
<List of={["1", "2", "3"]} each={x => <>{x}</>} />
And will generate the output 1 2 3
Yep <List/>
component is for dynamic lists since explicitly known static lists do not need a specialized component, i.e. you basically want this:
["1", "2", "3"].map(x => <>{x}</>)