SolidJSS
SolidJSโ€ข5mo agoโ€ข
4 replies
Liquido

What's the right way to make `textarea` elements reactive?

I have a store that I pass to a component. When I output the store value, it is working for normal text (e.g inside span), input elements, it does not show anything for textarea elements:

const store = createStore([{
  id: '1', value: 'hello'
}])

function Item(props) {
  return <>
    {props.data.value}
    <input value={props.data.value} />
    <textarea value={props.data.value} /> {/* Does not render anything, even on initial value */}
  </>
}

function List(props) {
  return <For each={props.store}>
    {item => <Item data={item} />}
  </For>
}
Was this page helpful?