Skip to content

Attributes not removed when set to null on updates #1448

@steadicat

Description

@steadicat

The behavior of attributes with a value of null or undefined is inconsistent. On first render they are not present on the element at all. On subsequent renders, the attribute sticks around with an empty value.

For example, <a href={null} /> renders what you expect (<a />), but if the value of href changes to null after the first render, you get <a href />. In the case of href (and likely others) an empty attribute has unintended side effects.

See this fiddle: http://jsfiddle.net/pGG2A/1/

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