Skip to content

Why doesn't ReactJS passthrough "unknown" DOM properties? #1730

Closed
@Swivelgames

Description

@Swivelgames

For instance, at the moment I have a <label>, that contains a valid for attribute. However, ReactJS (being the baby that it is) doesn't understand this for attribute... Instead of assuming the developer knows what the hell (s)he's doing, it strips it out and leaves a lovely comment about it in the console.

This is incredibly frustrating. I don't want it to strip out attributes that it doesn't understand. I just want it to pass them through. In addition to React's inability to provide adequate support for attributes that have existed since HTML 1.0, what happens when the HTML spec changes and new attributes are available for existing elements?

The bug here and issue being provided is not related to the for attribute, but to React's inability to trust that the developer knows what they're doing. The real bug here is that React assumes the developer does NOT know what they're doing, and strips out unknown attributes out of fear. This is much less than ideal and should be remedied.

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