0

I am having the following problem. In my application, I have a button and when you click it shows a pop-up with value1 and value2. You can edit them and press save or just cancel. Everything goes without a problem. But when I go to "Table" tab (which has a table), one of the columns should be influenced by the fact I changed value1. I think that the data is being fetched just once and no matter where I click and what I do it does not update it. However, if I refresh the page and go the table - the values will be updated. My problem is that this does not happen dynamically and I do not know how exactly to make it. Any advice will be welcomed!

DnA_alex
  • 3
  • 1

1 Answers1

0

Put a parent component with

this.state={ Col:"" }

and a function

handleChange = (event){
        this.setState({col:event.target.value});
    }

and give input an attribute

onChange={handleChange}

Make the table have

prop={this.state.col}

where a column have td with that proo

SadekMo
  • 20
  • 3