krvikash35 / react-ui-component

Themeable component with sensible animation
MIT License
0 stars 0 forks source link

Tooltip #6

Open krvikash35 opened 4 years ago

krvikash35 commented 4 years ago
krvikash35 commented 4 years ago

Links

Material UI Tooltip doc Material UI Tooltip source Antd Tooltip doc Antd Tooltip source Material design tooltip doc reach-ui tooltip doc

Get ref of props.children by cloning Get props.children dom handle https://itnext.io/lets-create-a-tooltip-with-react-hooks-48d12cf06241

krvikash35 commented 4 years ago

if we don't want extra wrapper for tooltip then either clone element or use hooks.

https://github.com/reach/reach-ui/issues/171

  1. Component based API: target component will be child for Tooltip component, and child component need to forward ref.
  2. Hooks based API: something like useTooltip that accept ref to element.