I am using React Bootstrap on this project, but some of the components don’t work for me. I got Panel, Accordian, and Modal to work, but FormGroup, ControlLabel, and FormControl don’t. (They actually make the Modal stop working when I add them to it.) Any ideas why this is happening and how to fix?
Thanks!
Here is my code: https://codepen.io/jennnico/pen/deKMMJ?editors=0010
let Panel = ReactBootstrap.Panel;
let Accordion = ReactBootstrap.Accordion;
let Modal = ReactBootstrap.Modal;
let FormGroup = ReactBootstrap.FormGroup;
let ControlLabel = ReactBootstrap.ControlLabel;
let FormControl = ReactBootstrap.FormControl;
return(
<div>
<Accordion>
{shapes.map((shape, index) =>(
<Panel className = "category" header={shape.shape} eventKey = {index} key = {index}>
<ul>
{shape.attributes.map((item)=>(
<li key={item}>{item}</li>
))}
</ul>
<input placeholder="Enter new attribute" value = {this.state.newAttribute} onChange={this.onAttributeChange}/>
<button onClick = {() => this.addAttribute(newAttribute, index)}>Add Attribute</button>
<br />
<button onClick = {() => this.delete(index)}>DELETE shape</button>
</Panel>
))}
</Accordion>
<Modal show={this.state.showAdd} onHide={this.close}>
<Modal.Header closeButton>
<Modal.Title>Add Shape</Modal.Title>
<Modal.Body>
<FormGroup
controlID="formgroup">
<ControlLabel>Shape Name</ControlLabel>
<FormControl
type="text"
value = {newShape.shape}
placeholder="Enter Shape Name"
onChange = {(event) => this.updateNewShape(event.target.value, newShape.attributes)}
></FormControl>
</FormGroup>
</Modal.Body>
</Modal.Header>
</Modal>