@@ -23,6 +23,7 @@ class StateHook<T> {
2323 /// The second item in the pair returned by [React.useState] .
2424 void Function (dynamic ) _setValue;
2525
26+ @Deprecated ('Use useState instead. Will be removed in 7.0.0.' )
2627 StateHook (T initialValue) {
2728 final result = React .useState (initialValue);
2829 _value = result[0 ] as T ;
@@ -33,6 +34,7 @@ class StateHook<T> {
3334 /// initialize [_value] to the return value of [init] .
3435 ///
3536 /// See: <https://reactjs.org/docs/hooks-reference.html#lazy-initial-state>.
37+ @Deprecated ('Use useStateLazy instead. Will be removed in 7.0.0.' )
3638 StateHook .lazy (T Function () init) {
3739 final result = React .useState (allowInterop (init));
3840 _value = result[0 ] as T ;
@@ -171,6 +173,7 @@ class ReducerHook<TState, TAction, TInit> {
171173 /// The second item in the pair returned by [React.useReducer] .
172174 void Function (TAction ) _dispatch;
173175
176+ @Deprecated ('Use useReducer instead. Will be removed in 7.0.0.' )
174177 ReducerHook (TState Function (TState state, TAction action) reducer, TState initialState) {
175178 final result = React .useReducer (allowInterop (reducer), initialState);
176179 _state = result[0 ] as TState ;
@@ -181,6 +184,7 @@ class ReducerHook<TState, TAction, TInit> {
181184 /// initialize [_state] to the return value of [init(initialArg)] .
182185 ///
183186 /// See: <https://reactjs.org/docs/hooks-reference.html#lazy-initialization>.
187+ @Deprecated ('Use useReducerLazy instead. Will be removed in 7.0.0.' )
184188 ReducerHook .lazy (
185189 TState Function (TState state, TAction action) reducer, TInit initialArg, TState Function (TInit ) init) {
186190 final result = React .useReducer (allowInterop (reducer), initialArg, allowInterop (init));
0 commit comments