Skip to content

useTwo width / height not reacting to updates #23

@haxiomic

Description

@haxiomic

Describe the bug

const { width, height, two } = useTwo();

If the two.js canvas resizes, i.e. through fit() or other, the width and height in useTwo() do not change and no re-render happens, however if you manually view two.width or two.height then this will reflect the correct latest size

To Reproduce
call two.fit(), in such a way as to trigger resize
see that no re-render happens

Expected behavior
width and height should be in sync and trigger react re-render

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions