Allows the parent to open and close the dropdown programmatically.
Provides a method to check if the dropdown is open.
Tasks
Implement the open, close, and isOpen methods in the Dropdown component.
Test the methods by interacting with the buttons in the parent component.
Ensure that the dropdown closes properly and displays its content when open.
1. CODING EXERCISE: BUILD A CONTROLLED DROPDOWN
OBJECTIVE
Create a Dropdown component that:
1. Allows the parent to open and close the dropdown programmatically.
2. Provides a method to check if the dropdown is open.
TASKS
1. Implement the open, close, and isOpen methods in the Dropdown component.
2. Test the methods by interacting with the buttons in the parent component.
3. Ensure that the dropdown closes properly and displays its content when open.
Discuss with Others
Ask questions, share your thoughts, and discuss with other learners
Join the discussion to ask questions, share your thoughts, and discuss with other learners