Textarea message isn't updated on value change. I
const textareaView = () => (state, actions) => h(
'textarea',
{
oninput(e) {
actions.setMessage(e.target.value);
},
},
[state.message]
)
Actions has method to reset state.message:
actions.resetMessage = () => (state) => ({
...state,
message: '',
});
When resetMessage is called, state's value resets properly and redraws the view except of textarea.
Instead of setting the textarea's children, you need to set it's value attribute.
const textareaView = () =>(state, actions) => h(
'textarea',
{
oninput(e) {
actions.setMessage(e.target.value);
},
value: state.message
}
)
Thanks, @SkaterDad.
Sounds like this is resolved now.
Most helpful comment
Thanks, @SkaterDad.
Sounds like this is resolved now.