Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-body mount host node #271

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/TokamakDOM/App/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ import TokamakCore
import TokamakStaticHTML

extension App {
public static func _launch(_ app: Self, _ rootEnvironment: EnvironmentValues) {
_launch(app, rootEnvironment, TokamakDOM.body)
}
/// The default implementation of `launch` for a `TokamakDOM` app.
///
/// Creates a host `div` node and appends it to the body.
///
/// The body is styled with `margin: 0;` to match the `SwiftUI` layout
/// system as closely as possible
///
public static func _launch(_ app: Self, _ rootEnvironment: EnvironmentValues) {
let body = TokamakDOM.body
public static func _launch(_ app: Self, _ rootEnvironment: EnvironmentValues, _ body: JSObjectRef) {
j-f1 marked this conversation as resolved.
Show resolved Hide resolved
if body.style.object!.all == "" {
body.style = "margin: 0;"
}
Expand Down