File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -73,23 +73,29 @@ struct ViewTreeBuilder<R: RootRegistry> {
7373
7474 let modified = view. applyModifiers ( R . self)
7575 let bound = applyBindings ( to: modified, element: element, context: context)
76- let withIDAndTag = applyIDAndTag ( element: element, to: bound)
76+ let withID = applyID ( element: element, to: bound)
77+ let withIDAndTag = applyTag ( element: element, to: withID)
7778
7879 return withIDAndTag
7980 . environment ( \. element, element)
8081 . preference ( key: ProvidedBindingsKey . self, value: [ ] ) // reset for the next View.
8182 }
82-
83+
8384 @ViewBuilder
84- private func applyIDAndTag( element: ElementNode , to view: some View ) -> some View {
85- let tag = element. attributeValue ( for: " tag " )
86-
85+ private func applyID( element: ElementNode , to view: some View ) -> some View {
8786 if let id = element. attributeValue ( for: " id " ) {
88- view. id ( id) . tag ( tag )
87+ view. id ( id)
8988 } else {
90- view. tag ( tag )
89+ view
9190 }
9291 }
92+
93+ @ViewBuilder
94+ private func applyTag( element: ElementNode , to view: some View ) -> some View {
95+ let tag = element. attributeValue ( for: " tag " )
96+
97+ view. tag ( tag)
98+ }
9399
94100 @ViewBuilder
95101 private func createView( _ element: ElementNode , context: LiveContextStorage < R > ) -> some View {
You can’t perform that action at this time.
0 commit comments