Design Patterns · Middle · Question 65 of 75
What are prop getters?
const { getInputProps, getItemProps } = useCombobox(...);
<input {...getInputProps({ onKeyDown: myHandler })} />- ✓Correct answer: Functions returning the props (handlers, ARIA attributes) a headless component needs, merged with the user's own props
- 2Getters on class components
- 3Functions that read props from the URL
Explanation
Users control markup while the library guarantees correct accessibility and event wiring.