Commit cec5acc
authored
Hooks (useState for copied, useCallback for handleCopy) were placed after conditional early returns for loading/error states, violating React Rules of Hooks. Moved both hooks above the early returns so all 11 hooks are called unconditionally on every render.
Root cause: the hooks violation was previously masked because the WASM binary was missing (404), so the component always stayed in the error branch. Once the WASM binary was committed (#423), the loading→ready transition exposed the hook count mismatch, triggering React error #310.
Fixes #427
1 parent 9562968 commit cec5acc
1 file changed
+9
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
| |||
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
193 | | - | |
194 | 202 | | |
195 | 203 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
0 commit comments