Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions