Commit ad3738b
committed
perf(Blocks,Block): add deep comparison to block/blocks memo call
React.memo uses a shallow comparison, which isn't enough in this case.
Using [welldone-software/why-did-you-render](https://github.com/welldone-software/why-did-you-render)
I found our homepage content would update 12 times in one load with the wdyr message
"different objects that are equal by value".
This change adds a deep comparison, which when tested via patch-package, eliminated those re-renders.1 parent 8bcaa92 commit ad3738b
File tree
4 files changed
+17
-2
lines changed- .changeset
- packages/sdks
- output/react-native
4 files changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
183 | 191 | | |
184 | 192 | | |
185 | 193 | | |
| |||
240 | 248 | | |
241 | 249 | | |
242 | 250 | | |
243 | | - | |
| 251 | + | |
244 | 252 | | |
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
248 | 256 | | |
249 | | - | |
| 257 | + | |
250 | 258 | | |
251 | 259 | | |
252 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7093 | 7093 | | |
7094 | 7094 | | |
7095 | 7095 | | |
| 7096 | + | |
7096 | 7097 | | |
7097 | 7098 | | |
7098 | 7099 | | |
| |||
0 commit comments