Skip to content

reconcile fails to replace nested array with object #2017

Closed
@Bubz43

Description

@Bubz43

Describe the bug

Basically the reverse of this issue. Using reconcile to replace a nested value that is an array with an object still leaves it as an array.

Your Example Website or App

https://playground.solidjs.com/anonymous/d43decad-3911-4beb-99e0-6a166b6655c6

Steps to Reproduce the Bug or Issue

  const [store, setStore] = createStore<{ value: [] | {} }>({ value: [] });
  setStore(reconcile({ value: {} }));
  expect(Array.isArray(store.value)).toBe(false);

Expected behavior

Expect the array to be replaced with an object, works without reconcile.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Vivaldi
  • Version: 6.5

Additional context

I don't think the playground version of solid has been updated to use the latest version so obj -> array bug exists there, but this bug exists both on older and latest (1.8.8) version.

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