Compound components allow you to create expressive APIs like <Toggle><Toggle.On>...</Toggle.On></Toggle> where parent and children share state implicitly.
Toggle component that uses createContext to share isOn and toggle stateToggle.On that only renders children if isOn is trueToggle.Off that only renders children if isOn is falseToggle.Button that triggers the toggleSubmit your code to see test results