Skip to content

Commit

Permalink
Merge pull request #182 from YusukeHosonuma/fix-focusstate
Browse files Browse the repository at this point in the history
fix: occur infinity-loop when include `@FocusState`
  • Loading branch information
YusukeHosonuma committed May 18, 2022
2 parents 7084247 + d2d286e commit 2194aa9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Sources/Core/PrettyDescriber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct PrettyDescriber {
"AppStorage",
"SceneStorage",
"GestureState",
"FocusState",
].contains { typeName.hasPrefix("\($0)<") }
}

Expand Down Expand Up @@ -207,6 +208,20 @@ struct PrettyDescriber {
}
}

//
// @FocusState
//
// Note: Currently not getting values, but implemented to prevent infinite loops.
//
if typeName.hasPrefix("FocusState<") {
// TODO: I don't know where to get the value of what's inside.
if debug {
return "@FocusState(<can not lookup>)"
} else {
return "<can not lookup>"
}
}

//
// @Environment
//
Expand Down

0 comments on commit 2194aa9

Please sign in to comment.