udecode / zustand-x

Zustand store factory for a best-in-class developer experience.
https://zustand-x.udecode.dev
MIT License
328 stars 20 forks source link

[DEPRECATED] Passing a vanilla store will be unsupported in a future version #60

Closed alshdotme closed 7 months ago

alshdotme commented 1 year ago

Description

When running unit tests I see the following deprecation warning in my console when using this package.

console.warn
      [DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.

It seems it is this line of createStore that is causing it:

middlewares.push(vanilla.createStore);

If I comment out this line, the console warning no longer propagates.

Steps

  1. Create a few stores, and merge into a global store
  2. Run a unit test on a component that is consuming a value from the store

Expectation

There are no console.warns propagating.

bolshchikov commented 9 months ago

@zbeyens , any updates on this one?

zbeyens commented 9 months ago

None, PR's welcome

zbeyens commented 7 months ago

Got it fixed. Note I've renamed the package to zustand-x. If you're using Jotai, take a look at jotai-x!