Skip to content

Either re-export all from Redux or make a peerDependency #238

@exogen

Description

@exogen

👋 Hello! I suspect that redux may need to be a peerDependency, but first I'll describe the issue I see:

$ yarn list redux
yarn list v1.19.0
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ redux-starter-kit@0.5.1
│  └─ redux@4.0.1
└─ redux@4.0.4
✨  Done in 0.82s.

I have two copies of redux in my tree, and redux-starter-kit is being supplied its own version.

Why do I depend on redux if I use redux-starter-kit? Well, some of my hooks do stuff like:

const dispatch = useDispatch();
const actions = useMemo(() =>
  bindActionCreators({ fooAction, barAction }, dispatch),
  [dispatch]
);

So they use bindActionCreators, which is exported from redux and not redux-starter-kit.

Regardless of this, I suspect that redux may need to be a peerDependency anyway, because other things declare it as a peerDependency, and if you rely on it to be supplied by redux-starter-kit then you have no guarantee what version you will get – it's not guaranteed that redux-starter-kit's version will be the one hoisted to the top of the node_modules tree.

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