everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React
https://www.react-laag.com
MIT License
907 stars 47 forks source link

Problem with default isOpen=true #30

Closed gizmooo closed 4 years ago

gizmooo commented 4 years ago

Laag does not wait for a delay in rendering React at the default value "isOpen = true" and throws an error:

Could not find a valid reference of the trigger element. See https://www.react-laag.com/docs/togglelayer/#children for more info.

default value
isOpen=true

case When the page is displayed, the tooltip should be visible

sandbox with error

const [show, toggle] = useState(true);

https://codesandbox.io/s/busy-night-3pjt5?fontsize=14&hidenavigation=1&theme=dark

everweij commented 4 years ago

Hi @gizmooo, Thanks for reporting this issue, and sorry for my late response!

I've just published v0.7.1, and hopefully this bug should be fixed now. Let me know if this works for you.

Erik