Skip to content

can't "reload" a component using a variable if its in use as a state #385

@yazaddaruvala

Description

@yazaddaruvala

Check out this fiddle, http://jsfiddle.net/JUbe3/1/
Line 70 is the real puzzler
It suggests that when you "select" a message, that the Content's color should go red.

  • I can change the color just fine when I hit "change color" (which is state controlled)
  • I can't do it when I "select a message" (which is porp controlled and in my assumption should reload the entire component with new properties)

I've tried removing any mention of this.state.color and only using this.props.color and things work as expected. I can change color when I select a message, however, obviously I cannot toggle the color using the link.

I did also try setting the Content's state from the select function but that just resulted in errors.

Maybe someone with a bit more experience knows a work around (which I would like to hear about) but I feel like this is intuitive and so should just work and thats why I've filed it as an issue.

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