Skip to content

Ensure that useMediaQuery has the "correct" initial value #1000

@Kyzegs

Description

@Kyzegs

New Features

What is the new or updated feature that you are suggesting?

Ensure that useMediaQuery returns the matched value for the given query in the first render.

Why should this feature be included?

In most cases, we do not want to load our animations on the initial page load. When we have a component with animations that relies on the useMediaQuery hook the following happens: The animation gets triggered because of the value from the hook changes. I've tried this with my animation implementation and libraries such as Framer Motion.

Having the correct initial value would fix this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions