Skip to content

react-spring SideEffects must be set to true #30454

Closed
@joshuaellis

Description

@joshuaellis

Description

This issue has been reported to us a few times see: pmndrs/react-spring#1239 & pmndrs/react-spring#1069 as an example. Peoples workaround is to enforce sideEffects:true on the particular package:

exports.onCreateWebpackConfig = ({ stage, actions }) => {
  if (stage.startsWith("build-javascript")) {
    actions.setWebpackConfig({
      module: {
        rules: [
          {
            test: /react-spring/,
            sideEffects: true
          }
        ]
      }
    })
  }
}

It'd be great to get your feedback on whether this is the intended fix for the issue or it's a bug in either library that can be fixed. If it's the correct thing to do then I can add some documentation to let everyone know so neither library gets the bugs.

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