Skip to content

@emotion/babel-preset-css-prop or babel-plugin-emotion is not work well with react-refresh #1953

@lightyen

Description

@lightyen

I'm a beginner with emotion and react fast refresh, I found that emotion doesn't work well with react-refresh.

The input data should not be clear after hot update, it annoyed me when I want to develop something.

I also tried styled-components(babel-plugin-styled-components), it works nicely.

Current behavior:

Input data is gone after hot update.

To reproduce:

https://github.com/lightyen/emotion-react-refresh-demo

Expected behavior:

Input data keep the same value after hot update.

Environment information:

Described in demo repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions