Skip to content

spread() doesn't use the children property when an Accessor is passed #2342

@AFatNiBBa

Description

@AFatNiBBa

Describe the bug

The type definition of the spread() function states that it also accepts a function that returns an object instead of the object itself, but here it doesn't check if props is a function when accessing the children property.
After checking with the playground, it seems that no property works

Your Example Website or App

https://playground.solidjs.com/anonymous/8afd997e-2827-47bf-b670-bcfbd3825315

Steps to Reproduce the Bug or Issue

Just look at the output:

  • "This works" is visible
  • "This doesn't" should be visible but isn't

Expected behavior

It should get the properties from the returned object if props is a function OR the type definition should be made to match the actual behaviour by disallowing Accessors

Screenshots or Videos

No response

Platform

  • OS: Windows 11
  • Browser: Edge 129.0.2792.89
  • Version: 1.9.2

Additional context

May be related to #1296

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptrelating to typescript or types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions