Skip to content

zustand create and createContext deprecated. #728

Closed
@mbassett1

Description

@mbassett1

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';

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions