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

Error: (0 , _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect) is not a function #2046

Closed
1 task done
xybl3 opened this issue Jun 26, 2023 · 5 comments
Closed
1 task done

Comments

@xybl3
Copy link

xybl3 commented Jun 26, 2023

What version of React, ReactDOM/React Native, Redux, and React Redux are you using?

  • React: 18.2.0
  • ReactDOM/React Native: ReactDOM 18.2.0
  • Redux:4.2.1
  • React Redux: 8.1.1

What is the current behavior?

I am trying to dispatch interface

export interface AccountDiscord {
  accent_color: string | null;
  avatar: string | null;
  avatar_decoration: string | null;
  banner: string | null;
  banner_color: string | null;
  discriminator: string;
  email: string | null;
  flags: number | null;
  global_name: string | null;
  id: string;
  locale: string;
  mfa_enabled: boolean;
  premium_type: number;
  public_flags: number | null;
  username: string;
  verified: boolean;
}

and it throws me an error
Unhandled Runtime Error
Error: (0 , _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect) is not a function

What is the expected behavior?

It should dispatch that object to state and render normal react view

Which browser and OS are affected by this issue?

No response

Did this work in previous versions of React Redux?

  • Yes
@markerikson
Copy link
Contributor

Where and how are you trying to use React-Redux? Is this by any chance inside of the new Next.js 13 app directory?

@xybl3
Copy link
Author

xybl3 commented Jun 26, 2023

Yes, thats correct

@markerikson
Copy link
Contributor

@xybl3 @phryneas knows more about this than I do, but in general you can't use anything with React hooks directly inside of a server component. You'll need to change the <Provider> or useSelector usages into client components.

@phryneas
Copy link
Member

Yeah, generally my first question would be if you are in a client component.

@xybl3
Copy link
Author

xybl3 commented Jun 26, 2023

My bad, I did it and it worked. Thanks for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants