Closed corysimmons closed 4 years ago
This would be really handy with things like styled-components. I peeked at the source and it looks like it's using useEffect under the hood, so I'm not sure why it isn't able to watch/update appropriately.
https://codesandbox.io/s/useresizeobserver-react-hook-cstgc
You have a missing px in your CSS calc, just change it to: calc(300px + ${props.h}px)
px
calc(300px + ${props.h}px)
hah, my bad. Thanks Viktor. :)
This would be really handy with things like styled-components. I peeked at the source and it looks like it's using useEffect under the hood, so I'm not sure why it isn't able to watch/update appropriately.
https://codesandbox.io/s/useresizeobserver-react-hook-cstgc