mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-07 04:23:40 +09:00
Ref https://github.com/webstudio-is/webstudio/issues/2532 Collections will introduce nested scope within same component and some expressions at component scope will not be able to access collection item. For example ```ts const PageComponent = () => { let [value, set$value] = useState('') let show = value === 'error' let arialabel = item + ' label' return <Form> <ErrorMessage data-ws-show={show}></ErrorMessage> {list.map(item => <Button aria-label={arialabel}></Button> )} </Form> } ``` So the easiest way to workaround it without complicated scope selecting is just inline all expressions into props. ```ts const PageComponent = () => { let [value, set$value] = useState('') return <Form> <ErrorMessage data-ws-show={value === 'error'}></ErrorMessage> {list.map(item => <Button aria-label={item + ' label'}></Button> )} </Form> } ``` ## Steps for reproduction 1. Create `Form` 2. Try to change `state` prop