-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Description
Hello,
first of all thank you for the awesome package. I love both technologies and played with it a bit.
In the documentation I found no way to pass state or child components.
class App extends React.Component {
constructor() {
super();
this.state = {
isFlipped: false
};
this.handleClick = this.handleClick.bind(this);
}
handleClick(e) {
e.preventDefault();
this.setState(prevState => ({ isFlipped: !prevState.isFlipped }));
}
render() {
return (
<ReactCardFlip isFlipped={this.state.isFlipped} flipDirection="vertical">
<YOUR_FRONT_CCOMPONENT key="front">
This is the front of the card.
<button onClick={this.handleClick}>Click to flip</button>
</FrontComponent>
<YOUR_BACK_COMPONENT key="back">
This is the back of the card.
<button onClick={this.handleClick}>Click to flip</button>
</BackComponent>
</ReactCardFlip>
)
}
}
ReactDOM.render(<App />, document.querySelector("#pivot-example"));
I would like to use this Flip Card Component for example. It is possible to pass state? This Component also only works with Childcomponents. Is there a way to pass an Actionbutton for example?
Thank you :-)