Skip to content

facing type error on upgrading react version from 17 -> 18 #3321

@tushar27042

Description

@tushar27042

Facing this issue only when upgrading the react version from 17 to 18.

Current behavior:

css="You have tried to stringify object returned from css function. It isn't supposed to be used directly (e.g. as value of the className prop), but rather handed to emotion so it can handle it (e.g. as value of css prop)."

Image
  1. import { jsx /* css */ } from "@emotion/react";
  2. export const railnavMenuWrapper = css <some css & rules> ``
  3. <div css={railnavMenuWrapper}></div>

Expected behavior:

Should work smoothly without throwing any error or breaking the css.

Environment information:

  • react version: 18.3.1
  • @emotion/react version: 11.8.
  • node-version: 22.14.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions