Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 11 2015 13:30

    malditogeek on master

    Update README (compare)

  • May 11 2015 13:27

    malditogeek on master

    Added Procfile Pass oauth redirect and session… Merge branch 'master' of github… (compare)

  • May 11 2015 11:51
    malditogeek opened #7
  • May 11 2015 11:30

    malditogeek on master

    Added Gitter badge Merge pull request #6 from gitt… (compare)

  • May 11 2015 11:30
    malditogeek closed #6
  • May 11 2015 11:29
    gitter-badger opened #6
akopichin
@akopichin
Hi guys.

Have a question:
I have component which calls another one. Moreover prop of called component is function which should communicate with that component.

<comp1>

<comp2 itemRender={ (item) => <comp3 key= {item.id} item={item} />} />

end of main comp />
So. comp3 it’s item of comp2. How to make comp3 send it’s item to comp2 by click on one of item3?

Razzwan
@Razzwan
How can I improve this code?
var Button = React.createClass({
    handler1: function() {
        alert("Button 1 press!");
    },

    handler2: function() {
        // do something else
    },

    render: function() {

        return (
            <button onClick={eval("this." + this.props.handler)}>
                {this.props.name}
            </button>
        );
    }

});

ReactDOM.render(
    <Button name="Name" handler="handler1" />,
    document.getElementById('button')
);
Can I replace eval whith something better?
akopichin
@akopichin
@Razzwan I think it's arch. problem.
What case you have to use eval?
Razzwan
@Razzwan
It was so long ago, I do not remember.
akopichin
@akopichin
anyway, you can use hash inside the button )
Razzwan
@Razzwan
Now I know, how to solve this problem. Thank you.
akopichin
@akopichin
Ok )
shreyas23sk
@shreyas23sk
Hello
Razzwan
@Razzwan
Hi!