cyntler / hamburger-react

Animated hamburger menu icons for React.js weighs only 1.5 KB.
https://hamburger-react.netlify.app
MIT License
972 stars 36 forks source link

feat: use transform only transitions #48

Closed Djoow closed 2 years ago

Djoow commented 2 years ago

For now, in this project, transitions are reacting to any kind of changes. In some cases, if something change on burger hover for example, transitions are wrongly triggered.

This fix allows transitions to be triggered only on css transform property change, allowing external interactions on the burger (background color change, etc).

luukdv commented 2 years ago

Thanks for the PR!

In a lot of cases, you'll want to do something like this:

<Hamburger toggle={toggle} toggled={toggled} color={toggled ? 'white' : 'black'} />

Previously this would animate nicely along with the other transitions, but this would break in your current approach.

luukdv commented 2 years ago

Closing due to inactivity.