( inst: Instance, old: Rec, view: View.Child<any, any> )
| 1865 | |
| 1866 | /** @internal */ |
| 1867 | export const patchChild = ( |
| 1868 | inst: Instance, |
| 1869 | old: Rec, |
| 1870 | view: View.Child<any, any> |
| 1871 | ): Rec => { |
| 1872 | const child = old.inst |
| 1873 | const shown = old.kids |
| 1874 | if (shown === undefined && inst.tree.holds?.(child, inst, view) === true) { |
| 1875 | return old |
| 1876 | } |
| 1877 | // Hydration replays a held view outside any render, and slot content can patch without one. |
| 1878 | inst.tree.flushes?.writing() |
| 1879 | old.v = view |
| 1880 | if (shown !== undefined) { |
| 1881 | // The host settles a held child with the latest view. |
| 1882 | if (shown[0]!.v === heldText) return old |
| 1883 | shown[0] = child === inst |
| 1884 | ? inFallback(inst, () => patch(inst, shown[0]!, fallbackOf(inst, view, causeOf(inst, view)))) |
| 1885 | : patch(inst, shown[0]!, fallbackOf(inst, view, child.failure)) |
| 1886 | return old |
| 1887 | } |
| 1888 | const changed = applyProps(child, view.props) |
| 1889 | if (child.closed) return old |
| 1890 | if (changed || view.view !== undefined) { |
| 1891 | if (child === receiving) markDirty(child) |
| 1892 | else render(child) |
| 1893 | } |
| 1894 | const placed = child.placed |
| 1895 | if (placed !== undefined && !child.closed) { |
| 1896 | for (const entry of placed.values()) { |
| 1897 | refresh(child, entry) |
| 1898 | } |
| 1899 | } |
| 1900 | return old |
| 1901 | } |
| 1902 | |
| 1903 | /** @internal */ |
| 1904 | export const replace = ( |
no test coverage detected