docs icon indicating copy to clipboard operation
docs copied to clipboard

Example in "Immutable Data" consists of function no longer callable

Open tfulanchan opened this issue 1 year ago • 0 comments

Concerning the example in Immutable Data ,

//here
import produce from 'immer'
import { shallowRef } from 'vue'

export function useImmer(baseState) {
  const state = shallowRef(baseState)
  const update = (updater) => {
    state.value = produce(state.value, updater)
  }

  return [state, update]
}

immer.js has undergone changes in its export patterns and the example in the Playground maybe outdated and requires attention.

Screenshot 2024-02-10 062917 Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/immer.js?v=46fe6564' does not provide an export named 'default' (at immer.js:1:8)

tfulanchan avatar Feb 10 '24 11:02 tfulanchan