Got the favourites star to show up as the same color. It had something to do with the asyncronicity of loading the state from the contents page. Strange though, because the Select states were updating in the UI, based on the state received from the contents page, but the favourites star was not updating in the same way.

Maybe because I was updating a styling element, or maybe because it is an SVG. Not sure exactly, but anyway what I did is update the color of the star from the container element. After the this.setState({applicationState:applicationState}) had been done, I updated the color of the star via jquery. All this carried out in the container element. Ideally we would want the styling for the favourites star to go in the favourites component, bur I tried doing this in several different way, including:

  • putting the style object as a variable in the script
  • putting the style object as a state variable in the component
  • inject the style color as a prop
  • puttng the style variabe inside the render(){} section.

It never worked properly. I am sure it had something to do with the asynchronous loading. But even if it is asynchronous, I would have though that if i injectjed the color as a prop, then when it

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s