designsystemet icon indicating copy to clipboard operation
designsystemet copied to clipboard

How do we solve interconnected component props?

Open mimarz opened this issue 5 months ago • 4 comments

Work in progress writing description, but will outline different approaches we have tried and potential other ways of solving inter-connected component props in React.

  1. .Root
  2. .Context
  3. "Hooks" instead of Context, like react-aria useTextfield

Notes:

  • Should our othermost .Context represent the component context or something else?
  • Can we get away without using React Context?
  • .Context is used in two different way currently.
  • https://github.com/digdir/designsystemet/pull/2432#pullrequestreview-2312554652
  • https://designsystemet.slack.com/archives/C07K7NEKXEW/p1726656413211339

mimarz avatar Sep 18 '24 13:09 mimarz