I got the following snippet to open and close forms on my page:

```
 <div>
   {this.state.editFormOpen?
   <div>
       <Link
          to=''
          onClick={()=>{this.setState({editFormOpen:false})}}>
          Close
       </Link>
       <PostForm
           onSubmit={(post)=>this.createPost(post)}
       />
   </div>:
   <Link
     to=''
     onClick={()=>{this.setState({editFormOpen:true})}}>
     Add post
  </Link>}
</div>

```

Now in order to avoid repeating myself, I want to refactore that code into a seperate `<FormHandler/>` component, such that it works for arbitrary forms, not only
`<PostForm/>`. I.e., I need to be able to pass any form component to the `<FormHandler/>`.

How can I do this in React?