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
import{useState}from'react';import{Button,Textarea}from"@canonical/react-components";functionApp(){const[data,setData]=useState("Default text");return(<div><ButtononClick={()=>setData("")}>
Show nothing
</Button><p>Current data is: {data}</p><Textareavalue={data}onChange={(e)=>setData(e.target.value)}/></div>);}
This is the default scenario:
I'd expect clicking the button to clear the value in the Textarea. However, while the state is correctly updated (to an empty string), the Textarea still shows the previous value.
The text was updated successfully, but these errors were encountered:
Consider this simplified example:
This is the default scenario:
I'd expect clicking the button to clear the value in the
Textarea
. However, while the state is correctly updated (to an empty string), theTextarea
still shows the previous value.The text was updated successfully, but these errors were encountered: