vendredi 26 août 2016

Pass a trigger function to two components

Here is what i want to do:

render() {
    return (
        <div>
            <Child onTrigger={xxx} />

            <button onClick={xxx} />
        </div>
    )
}

When button is clicked, I want something to happen in Child. How do I do this? It cannot just be a boolean because it should be a trigger and be called multiple times.

Aucun commentaire:

Enregistrer un commentaire