Skip to content

Different behavior for keys with undefined properties in style objects using preact/compat #3861

@jpnelson

Description

@jpnelson

It seems as though there's an issue with how Preact handles style props when values are explicitly undefined. It seems to be a little more nuanced than it just leaving undefined in though – I think it happens only when the object property was previously defined, and later becomes undefined:

To Reproduce

Expected behavior

I would expect the --x css property to actually be deleted when it becomes undefined, as this is what happens on initial render.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions