We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa79b34 commit 0fbdd95Copy full SHA for 0fbdd95
didact.js
@@ -219,7 +219,7 @@ function useState(initial) {
219
})
220
221
const setState = action => {
222
- hook.queue.push(action)
+ hook.queue.push(typeof action === "function" ? action : (prev) => action)
223
wipRoot = {
224
dom: currentRoot.dom,
225
props: currentRoot.props,
@@ -316,4 +316,4 @@ function Counter() {
316
}
317
const element = <Counter />
318
const container = document.getElementById("root")
319
-Didact.render(element, container)
+Didact.render(element, container)
0 commit comments