mirror of
https://github.com/bendtherules/react-hooks-with-class.git
synced 2026-08-18 13:53:06 +00:00
Note on multiple setKey calls
This commit is contained in:
@@ -133,6 +133,8 @@ export default class App extends Component {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
const [item] = data.results;
|
const [item] = data.results;
|
||||||
// TODO: If possible, batch these two updates
|
// TODO: If possible, batch these two updates
|
||||||
|
// In general, merging should be done for most set{Key} calls,
|
||||||
|
// to be similar to today's classes
|
||||||
setData(item);
|
setData(item);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}, () => ([this.getCount()]));
|
}, () => ([this.getCount()]));
|
||||||
|
|||||||
Reference in New Issue
Block a user