Skip to content

Can't perform a React state update on a component that hasn't mounted yet. #331

@florian-lefebvre

Description

@florian-lefebvre

I'm adding Keystatic to an existing Astro app. I've followed the guide, except for SSR:

  • I set output to hybrid
  • I added export const prerender = false to both src/pages/keystatic/[...params].astro and src/pages/api/keystatic/[...params].ts

(Btw I think this option should be added to guide as well)

When going to http://127.0.0.1:3000/keystatic, I get the following warning:

Warning: Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.

Nothing's broken, but I thought I'd mention it anyway

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions