Original code:
class Input extends React.PureComponent { render() { let {forwardedRef, ...otherProps} = this.props; return
; } } const TextInput = React.forwardRef((props, ref) => { return
}); class FocusableInput extends React.Component { ref = React.createRef() render() { return
; } // When the focused prop is changed from false to true, // and the input is not focused, it should receive focus. // If focused prop is true, the input should receive the focus. // Implement your solution below: componentDidUpdate(prevProps) {} componentDidMount() {} } FocusableInput.defaultProps = { focused: false }; const App = (props) =>
; document.body.innerHTML = "
"; const rootElement = document.getElementById("root"); ReactDOM.render(
, rootElement);
Dashboard
Start Trial
Sign In
Home
Product
Features
Use Cases
Customers
ROI Calculator
Integrations
Assessments
Tests
Questions
Pricing
Resources
Book: Evidence-Based Hiring
Blog
Support
Contact Us
Legal
For Jobseekers
© TestDome, 2024.