Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite re-rendering if ErrorBoundary is direct child of LocationProvider #277

Open
ghost opened this issue Dec 21, 2020 · 1 comment
Open
Labels
bug Something isn't working lib preact-iso, etc

Comments

@ghost
Copy link

ghost commented Dec 21, 2020

This component tree is crashing my page when I navigate between routes:

<LocationProvider>
    <ErrorBoundary>
        <div>
            <Router>
                <Home path='/' default />
                <About path='/about' />
            </Router>
        </div>
    </ErrorBoundary>
</LocationProvider>

Putting a div as the direct child of LocationProvider fixes it:

<LocationProvider>
    <div>
        <ErrorBoundary>
            <Router>
                <Home path='/' default />
                <About path='/about' />
            </Router>
        </ErrorBoundary>
    </div>
</LocationProvider>

It doesn't have to be a dom element, this also fixes it:

<LocationProvider>
    <SWRConfig value={SWRConfiguration}>
        <ErrorBoundary>
            <Router>
                <Home path='/' default />
                <About path='/about' />
            </Router>
        </ErrorBoundary>
    </SWRConfig>
</LocationProvider>

If there's any additional information needed please let me know.

@developit developit added bug Something isn't working lib preact-iso, etc labels Dec 21, 2020
@developit
Copy link
Member

Possibly related to preactjs/preact#2747 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib preact-iso, etc
1 participant