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
For instance, the Text element inside of EnvironmentDemo will never get any Environment injected. You can see this by putting the following print after // Inject @Environment values in StackReconciler.swift:
print(compositeView.view.type)
The Text element is never logged.
I'm not sure how to fix this. Do you have any ideas @MaxDesiatov ?
The text was updated successfully, but these errors were encountered:
The reason for it is that Text (and possibly other views) doesn't conform to ViewDeferredToRenderer. That means it's rendered as a "host" view directly. The distinction between "host" (truly primitive) and "composite" (that have meaningful body) views is made in the reconciler in TokamakCore based on their body type, host views have body type Never. ViewDeferredToRenderer allows renderers to override that per-platform and render host views as composite by providing their deferredBody implementation. The @Environment handling you've added is only applied to composite views as it's added in the same place where @State is handled. The latter is only available to truly composite views. Most probably the environment injection shouldn't happen there, but somewhere else.
For instance, the
Text
element inside ofEnvironmentDemo
will never get any Environment injected. You can see this by putting the following print after// Inject @Environment values
inStackReconciler.swift
:The
Text
element is never logged.I'm not sure how to fix this. Do you have any ideas @MaxDesiatov ?
The text was updated successfully, but these errors were encountered: