I'm creating a small application for Cobalt using React. Everything looks good for now except of one thing: I can't make rerendered small piece of HTML on component's state change. I have a menu on the left and related component/HTML on the right side of a screen. When I change option in the menu I want the right component/HTML to be updated accordingly. Imagine I have 7 menu options. For all of them, except of 5th one, I want to just show the option text. Code in render method looks like:
this.state.selectedOption === 'fifthOption'
? <FifthComponent />
: (
<div className="wrapper">
<span className="title">{this.state.selectedOption}</span>
</div>)
In Chrome everything works perfect, but in Cobalt by some reason when I switch from 1st to second, third, fourth option - nothing changed and text of the first option is displayed. But it's changed when I switch from 5th option to 4th or 6th. No errors in console. So looks like it doesn't rerender "wrapper" on state change (but render method is launched).
I tried to add different classes to the 'div', make it as a 'switch' construction, make this 'div' as a separate component - all with no luck.
Any help would be really appreciated.