Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zustand create and createContext deprecated. #728

Closed
mbassett1 opened this issue Jan 23, 2023 · 1 comment
Closed

zustand create and createContext deprecated. #728

mbassett1 opened this issue Jan 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mbassett1
Copy link

mbassett1 commented Jan 23, 2023

I'm getting deprecation warnings when trying to test my tables:

console.warn
      [DEPRECATED] zustand/context will be removed in the future version. Please use `import { createStore, useStore } from "zustand"` for context usage. See: https://github.com/pmndrs/zustand/discussions/1180

      1 | import React from 'react'
    > 2 | import MaterialTable from '@material-table/core'
        | ^

      at createContext (node_modules/zustand/context.js:23:13)
      at Object.<anonymous> (node_modules/@material-table/core/dist/store/LocalizationStore.js:36:46)
      at Object.<anonymous> (node_modules/@material-table/core/dist/store/index.js:31:26)
      at Object.<anonymous> (node_modules/@material-table/core/dist/components/Overlay/OverlayError.js:18:14)
      at Object.<anonymous> (node_modules/@material-table/core/dist/components/index.js:137:44)
      at Object.<anonymous> (node_modules/@material-table/core/dist/defaults/props.components.js:12:19)
      at Object.<anonymous> (node_modules/@material-table/core/dist/defaults/index.js:10:37)
      at Object.<anonymous> (node_modules/@material-table/core/dist/index.js:110:17)

It appears material-table/core is using create and createContext in the Localization store. I'm assuming this needs to be updated with the later versions of zustand to match the given syntax in the warning? import { createStore, useStore } from "zustand".

import create from 'zustand';
import createContext from 'zustand/context';

@mbassett1 mbassett1 added the bug Something isn't working label Jan 23, 2023
@Domino987
Copy link
Contributor

Yes I noticed this. I have it updated locally and will be done with the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants