Skip to content

Documentation not clear about how to prevent unmounting components #119

@andreynering

Description

@andreynering

Since I disabled Turbolinks, I was trying to prevent react_ujs behavior unmounting components on page unload.

The documentation says:

react_ujs will also scan DOM elements and call React.unmountComponentAtNode on page unload. If you want to disable this behavior, remove data-react-class attribute in componentDidMount.

But I don't know how to do that:

var MyComponent = React.createClass({
  ...
  componentDidMount: function() {
    // ???
  }
});

It would be nice if the documentation give an example.

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