Complete the code to create a text input field in Figma.
<TextInput placeholder=[1] />The placeholder attribute sets the hint text inside the input field. Here, it should be a string like "Enter your name".
Complete the code to add a submit button with a label in Figma.
<Button label=[1] />The label property defines the text shown on the button. It should be a string like "Submit".
Fix the error in the code to correctly bind the input value to state in Figma.
const [value, setValue] = useState(''); <TextInput value=[1] onChange={e => setValue(e.target.value)} />
The value prop should be bound to the state variable value, not the setter function.
Fill both blanks to create a controlled checkbox input in Figma.
<Checkbox checked=[1] onChange=[2] />
The checked prop should be bound to a boolean state variable like isChecked. The onChange prop should be a function that updates this state, such as handleCheck.
Fill all three blanks to handle form submission and reset input in Figma.
const handleSubmit = (e) => {
e.[1]();
console.log(inputValue);
[2]('');
};
<form onSubmit={handleSubmit}>
<TextInput value={inputValue} onChange={e => [3](e.target.value)} />
<Button label="Submit" />
</form>To handle form submission properly, e.preventDefault() stops the page reload. Then, setInputValue('') resets the input. The input's onChange calls setInputValue to update state.