Skip to content

Commit

Permalink
Fix environment updates propagation to children
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov committed Aug 1, 2020
1 parent 08841e7 commit c397eb6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Sources/TokamakCore/MountedViews/MountedHostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public final class MountedHostView<R: Renderer>: MountedElement<R> {
while let child = mountedChildren.first, let firstChild = childrenViews.first {
let newChild: MountedElement<R>
if firstChild.typeConstructorName == mountedChildren[0].view.typeConstructorName {
child.environmentValues = environmentValues
child.view = firstChild
child.updateEnvironment()
child.update(with: reconciler)
Expand Down
2 changes: 1 addition & 1 deletion Sources/TokamakCore/Views/NavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct NavigationView<Content>: View where Content: View {
}

/// This is a helper class that works around absence of "package private" access control in Swift
public struct _NavigationViewProxy<Content: View> {
public struct _NavigationViewProxy<Content: View>: View {
public let subject: NavigationView<Content>

public init(_ subject: NavigationView<Content>) { self.subject = subject }
Expand Down
2 changes: 1 addition & 1 deletion Sources/TokamakStaticHTML/Views/NavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension NavigationView: ViewDeferredToRenderer {
width: 100%; height: 100%;
""",
]) {
_NavigationViewProxy(self).body
_NavigationViewProxy(self)
})
}
}

0 comments on commit c397eb6

Please sign in to comment.