Components are used in many frameworks and languages as the building blocks of an application.
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
This is a part of latest question addition to our question library.
The TextInput component renders an input element in the DOM and accepts a ref that is forwarded to that input element. Finish the FocusableInput component:
- The component should accept a focused prop.
- When the focused prop is changed from false to true, and the input is not focused, it should receive the focus.
- If on mounting the focused prop is true, the input should receive the focus.
- Property focused is true initially and the input has focus: Wrong answer
- Changing the focused prop focuses the input: Wrong answer