Skip to content

Receiving user-entered input  #7745

@pfhayes

Description

@pfhayes

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
When serving controlled inputs serverside from ReactDOM, the user might have entered data already before the clientside React has executed. In this case, the data the user has entered gets overwritten by the initial value.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
https://jsfiddle.net/k61pvqhk/

What is the expected behavior?
What mechanisms are available (or should be available) to capture this input? One natural solution I can imagine is some way to capture the user's entered text in getInitialState (or componentWillMount). We could hack this together by manually plucking the content from the DOM, but I'm interested to know if there is a more React-y solution if possible. The default of discarding the user's input is unlikely to be what is desired, for both the developer and the user.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
I have not observed this working in previous versions of React. I see this in Chrome on Mac OS X with React 15.

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