operational-ui icon indicating copy to clipboard operation
operational-ui copied to clipboard

[Umbrella] Migrate to Hooks

Open TejasQ opened this issue 6 years ago β€’ 5 comments

React Hooks has been merged and so it's time to rewrite our entire library in hooks to:

  1. Be cool, but also
  2. To more effectively reuse stateful logic between our components, and most importantly, to
  3. Be extra 1337.

There are 18 components that use class components and need to be migrated. Let this issue serve as an umbrella to port them over. Open separate issues if needed and update the checklist to include a link to the issue, instead of just plain text.

Components to Migrate

Internal Components

Internal Utilities

TejasQ avatar Feb 04 '19 14:02 TejasQ

Can I take Foldable up next? @TejasQ @fabien0102

adeelibr avatar Feb 08 '19 10:02 adeelibr

@adeelibr You can! πŸ’―

fabien0102 avatar Feb 08 '19 10:02 fabien0102

Hey guys- great library. Im just surfing around trying to sharpen my TS & react skills. I glanced at tooltip to see if i could tackle it and looks like @fabien0102 put some work on it. But I wanted to ask if useLayoutEffect would be better for measurement hooks?

JoshRosenstein avatar Feb 27 '19 04:02 JoshRosenstein

@JoshRosenstein, thanks for your amazing contributions! πŸŽ‰ How would Tooltip look with useLayoutEffect? I'm not really seeing the need for synchronicity there?

TejasQ avatar Feb 28 '19 17:02 TejasQ

@JoshRosenstein I would like to refactor this component since a long time (but time… you know πŸ˜… ). useLayoutEffect fit perfectly in this use case, so if you want to play with, be my guest! πŸŽ‰ Since we need to wait for the dom to calculate the size of the tooltip, it's perfect!

fabien0102 avatar Feb 28 '19 17:02 fabien0102