Project

General

Profile

Actions

Bug #20328

closed

mounting react component twice doesn't work consistently

Added by Ohad Levy almost 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JavaScript stack
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When using the react mounter (https://github.com/theforeman/foreman/blob/develop/webpack/assets/javascripts/react_app/common/MountingService.js) and somehow (usually via ajax) mount a component into an existing div (that already have a react on it), the portion showed on the screen will differ based on how the top level mounted component is implemented (e.g. some will read the state from the store, others will reinit it etc).

I would suggest that since this is usually a side effect of using react via ajax (e.g. compute resource vm tab is reloaded because you selected a different org) we should default to clearing the react component div prior to remounting it.

Actions

Also available in: Atom PDF