(react) add useControllableState hook

This hook is used to create a state that can be controlled by the parent.
If not the state is handled internally. We start to have this redundant
use case across Cunningham, so creating a dedicated hook reduces the
components verbosity and complexity.
This commit is contained in:
Nathan Vasse
2023-12-20 11:01:24 +01:00
committed by NathanVss
parent 3dd7b3ef8e
commit 6d91c1d19f
3 changed files with 119 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": minor
---
add useControllableState hook