Is it a bad practice to use state in a React component if the data will not change? Should I use a property on the class instead?
问题 Say I have React component that renders a set of buttons,I store the information for the buttons in an object, with a label and a method to run when they are attached. The buttons do not need to react to any changes, and will never change themselves. Is it a bad practice to store the information for these buttons in the state? These are the current solutions I have come up with so far. 1. Storing Buttons in State class Header extends Component { constructor() { super(); this.state = { buttons