Skip to content

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

Closed
@tfulanchan

Description

@tfulanchan

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)

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