-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add basic ButtonStyle
implementation
#214
Conversation
// | ||
// Created by Gene Z. Ragan on 07/22/2020. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the format for the header? Are we keeping these lines or removing them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't mind their presence (or absence) at all. They are added by Xcode, while files with no timestamps like that were created in other editors I guess (mine certainly were). I think adding these lines to files that don't currently have them is too much hassle, so if you want consistency it would be probably easier to just remove them everywhere.
Looks like pointer events are fixed now and |
Implements support for custom scenes by adding the new `MountedScene` type and fixes environment propagation from mounted parent to mounted child elements. This will unblock #136 and potentially #214. In the former scenes are always completely unmounted and remounted from scratch when root environment changes, which causes descendants to lose all `@State` values. I saw some environment propagation issues in the latter, but not sure if those were caused by the lack of correct scene updates, just wanted to tackle the usual suspects first. I've also improved reconciler-related doc comments to clarify some of the design desicions and naming. Resolves #222.
# Conflicts: # Sources/TokamakDOM/DOMRenderer.swift
/// Extract all `DynamicProperty` from a type, recursively. | ||
/// This is necessary as a `DynamicProperty` can be nested. | ||
/// `EnvironmentValues` can also be injected at this point. | ||
func dynamicProperties(_ environment: EnvironmentValues, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved to MountedElement.swift
to maintain just a single extension there.
Merging #214 broke the tests. Also, `DefaultButtonStyle` seems to be trivial enough to be shared through `TokamakCore` between all renderers.
This based off the
buttonstyles
branch by @Outcue.Initially it didn't work because mounted host views didn't propagate their environment on updates. This is now fixed by adding
updateEnvironment
function onMountedElement
base class and calling it in the initializer. Manual environment updates are no longer needed inmakeMounted...
factory functions.makeMountedApp
is no longer needed at all andMountedApp
initializer can be used directly then.