how to rerender component react when javascript class changes code example Example: React best way of forcing component to update this.forceUpdate();