diff --git a/imports/ui/Settings.jsx b/imports/ui/Settings.jsx index b9b130f..7722784 100644 --- a/imports/ui/Settings.jsx +++ b/imports/ui/Settings.jsx @@ -1,7 +1,7 @@ import React from 'react' import AddPlant from './AddPlant' import Plants from './Plants' -import { Button, Form, Container, Row, Col, Table } from 'react-bootstrap'; +import { Container, Row, Col} from 'react-bootstrap'; class Settings extends React.Component{ @@ -15,8 +15,8 @@ class Settings extends React.Component{ // pass this function to the addplant comp as a prop addPlant = (plant) => { - plant.id = Math.random(); // TODO rework - + plant.id = this.state.plants.length + 1 // TODO rework + console.log(plant.id) let plants = [...this.state.plants, plant]; // create a copy of the array and add the new plant to it this.setState({