0

I have implemented following example of react-bootstrap-table: https://stackblitz.com/edit/react-kr8ef2

I want to store the total in react state. How to set state?

Sameer Thite
  • 2,189
  • 2
  • 10
  • 13
  • You have the complete data with you. What is stopping you from calculating total and storing it to a state variable? – Agney May 29 '18 at 12:22
  • I was trying to store total in state from existing footerData variable so that there is no need to write extra function for total. It worked when I tried below solutions. Thank you – Sameer Thite May 30 '18 at 06:19

1 Answers1

-1

Try this example closer to the React way https://stackblitz.com/edit/react-e53dgq?file=index.js

Cristian Muscalu
  • 9,007
  • 12
  • 44
  • 76
  • You are changing the state without using `setState` and it is not close to react way at all – Agney May 30 '18 at 10:48