Skip to content

Race conditions while using react-router-6 adapter #286

Open
@shughes-uk

Description

@shughes-uk

I've been noticing race conditions with the react-router-6 adapter that don't seem to occur when just using the window adapter.

Specifically this seems to happen in situations where a navigate occurs below a component that is setting a query param.

const someComponent = () => {
    const [useQueryParam, setUseQueryParam] = useQueryParam(false);
    useEffect(() => {
        setUseQueryParam(true,"replaceIn");
    }
    return (
        <Navigate to= "/someRoute" replace  />
    )
}

This results in the url just having the query param, and not navigating to /someRoute. It works fine if you don't use replace. I have experimental batching turned on.

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