Skip to content

Next.js 13: SWRConfig should mark components as "use client" #2253

Closed
@itta611

Description

@itta611

Bug report

SWRConfig is used for top class components (e.g. layout), but the component SWRConfig is not defined as the Client Components.
Therefore, developer have to write "use client", which makes all components in the layout as Client Components.

Description / Observed Behavior

Server Error
TypeError: react.createContext is not a function

Expected Behavior

Therefore, the developer must write "use client", which makes all components in the layout client components.

Additional Context

swr: 1.3.0
next: 13.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions