Skip to content

Commit 6be9598

Browse files
stephencelismluisbrown
authored andcommitted
Document ScrollViewReader problem (#268)
1 parent ffe3495 commit 6be9598

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Sources/ComposableArchitecture/SwiftUI/WithViewStore.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import SwiftUI
77
/// Due to a bug in SwiftUI, there are times that use of this view can interfere with some core
88
/// views provided by SwiftUI. The known problematic views are:
99
///
10-
/// * If a `GeometryReader` is used inside a `WithViewStore` it will not receive state updates
11-
/// correctly. To work around you either need to reorder the views so that `GeometryReader`
12-
/// wraps the `WithViewStore`, or, if that is not possible, then you must hold onto an explicit
13-
/// `@ObservedObject var viewStore: ViewStore<State, Action>` in your view in lieu of using
14-
/// this helper (see [here](https://gist.github.com/mbrandonw/cc5da3d487bcf7c4f21c27019a440d18)).
10+
/// * If a `GeometryReader` or `ScrollViewReader` is used inside a `WithViewStore` it will not
11+
/// receive state updates correctly. To work around you either need to reorder the views so that
12+
/// the `GeometryReader` or `ScrollViewReader` wraps `WithViewStore`, or, if that is not possible,
13+
/// then you must hold onto an explicit `@ObservedObject var viewStore: ViewStore<State, Action>`
14+
/// in your view in lieu of using this helper (see
15+
/// [here](https://gist.github.com/mbrandonw/cc5da3d487bcf7c4f21c27019a440d18)).
1516
/// * If you create a `Stepper` via the `Stepper.init(onIncrement:onDecrement:label:)` initializer
1617
/// inside a `WithViewStore` it will behave erratically. To work around you should use the
1718
/// initializer that takes a binding (see

0 commit comments

Comments
 (0)