3 ms·
Basically a complex version of this example, done over and over, for larger methods. togglePanel = (newTogglePanelComponentState: Boolean) => { return th
by sbr464 7y ago
Basically a complex version of this example, done over and over, for larger methods.
togglePanel = (newTogglePanelComponentState: Boolean) => {
return this.setState({ panelToggleState: newTogglePanelComponentState });
}
togglePanel = bool => this.setState({ panelToggle: bool })
- paavohtl 7y agoI don't understand what you're trying to demonstrate with your example. Your TS(?) example is needlessly complicated, and syntactically invalid. Here's a better TS implementation: togglePanel = (panelToggle: bool) => this.setState({ panelToggle })
- sbr464 7y agoI agree, it wasn't a good example. More was (attempting) to make a point when inside a complex file, what I've seen. With long interface names mixed in with long variable names, contributing to larger files sizes than necessary. It varies depending on project/company. It's lowercase `boolean`.