Prop onChange mapping lvgl object event LV_EVENT_VALUE_CHANGED
interface PARAM_TYPE {
target: componentInstance; // original target
currentTarget: componentInstance; // current target object, not the original object
stopPropagation: () => {}; // stop event bubble
value: string;
}
interface CALLBACK_TYPE {
(e: PARAM_TYPE): void;
}
onClick callback with the following type
- CALLBACK_TYPE[]
- CALLBACK_TYPE
- null
import { Input } from 'lvlgjs-ui'
import { useState } from 'react'
function Component () {
const [value, setValue] = useState()
return (
<React.Fragment>
{/* controlled */}
<Input
style={style.input}
onFocus={() => console.log('focus')}
onFocusStyle={style.onFocusStyle}
onChange={(e) => setValue(e.value)}
mode="password"
value={value}
/>
{/* not controlled */}
<Input
style={style.input}
onFocus={() => console.log('focus')}
onFocusStyle={style.onFocusStyle}
mode="password"
/>
</React.Fragment>
)
}
const style = {
input: {},
onFocusStyle: {}
}
test/textarea/1