Skip to content

Commit 46a38d2

Browse files
Fix missing inferred generics
1 parent 8d1a829 commit 46a38d2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example/test/function_component_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Map reducer(Map state, Map action) {
114114
}
115115

116116
UseReducerTestComponent(Map props) {
117-
final state = useReducerLazy(reducer, props['initialCount'], initializeCount);
117+
final state = useReducerLazy(reducer, props['initialCount'] as int, initializeCount);
118118

119119
return react.Fragment({}, [
120120
state.state['count'],
@@ -297,7 +297,7 @@ final randomUseLayoutEffectTestComponent =
297297
react.registerFunctionComponent(RandomUseLayoutEffectTestComponent, displayName: 'randomUseLayoutEffectTest');
298298

299299
RandomUseLayoutEffectTestComponent(Map props) {
300-
final value = useState(0);
300+
final value = useState<num>(0);
301301

302302
useLayoutEffect(() {
303303
if (value.value == 0) {
@@ -317,7 +317,7 @@ final randomUseEffectTestComponent =
317317
react.registerFunctionComponent(RandomUseEffectTestComponent, displayName: 'randomUseEffectTest');
318318

319319
RandomUseEffectTestComponent(Map props) {
320-
final value = useState(0);
320+
final value = useState<num>(0);
321321

322322
useEffect(() {
323323
if (value.value == 0) {

test/hooks_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ main() {
212212
final mountNode = DivElement();
213213

214214
UseReducerTest = react.registerFunctionComponent((Map props) {
215-
final state = useReducerLazy(reducer2, props['initialCount'], initializeCount);
215+
final state = useReducerLazy(reducer2, props['initialCount'] as int, initializeCount);
216216

217217
return react.div({}, [
218218
react.div({

0 commit comments

Comments
 (0)