0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【TCA】State初期化直後からアラートが表示できない

Posted at

事象

Stateの初期化時にアラートを作成すると表示されなかった

@Reducer
struct Home {
    struct State: Equatable {
        @Presents var alert: AlertState<AlertAction>
    }
    //省略
}


HomeView(
    store: Store(
        initialState:Home.State(alert: AlertState<AlertAction>(...))
    ){
        Home()
    }
)

解決策

忙しくてあまり調査はできてない。
元々onAppearでactionを送っていたのでそのタイミングでアラートを初期化するように変更。nil -> nonnilにならないと評価されてないのだろうか。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?