You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/components.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,9 @@ m(Header, {
239
239
240
240
#### Avoid component factories
241
241
242
-
Component diffing relies on strict equality checking, so you should avoid recreating components. Instead, consume components idiomatically.
242
+
If you create a component from within a `view` method (either directly inline or by calling a function that does so), each redraw will have a different clone of the component. When diffing component vnodes, if the component referenced by the new vnode is not strictly equal to the one referenced by the old component, the two are assumed to be different components even if they ultimately run equivalent code. This means components created dynamically via a factory will always be re-created from scratch.
243
+
244
+
For that reason you should avoid recreating components. Instead, consume components idiomatically.
0 commit comments