Skip to content

Unable to Style canvas #1444

Answered by wojtekmaj
joshua-mcfield99 asked this question in Q&A
Discussion options

You must be logged in to vote

Do NOT style canvas this way. Instead, explicitly pass the width prop to the Page component. This is the only way to ensure that all layers stay aligned and everything looks good.

If it has to be dynamic, consider listening for window resize or container resize. I have handy hooks for this occasion - useWindowWidth and useIntersectionObserver - in my package @wojtekmaj/react-hooks, but of course, you can implement it yourself, too.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by wojtekmaj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants