-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for PseudoStaticLifecycleDiagnostic
- Loading branch information
1 parent
66d4ae2
commit 519f4cc
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:over_react/over_react.dart'; | ||
|
||
part 'dom_prop_types.over_react.g.dart'; | ||
|
||
UiFactory<HammerTimeProps> HammerTime = | ||
// ignore: undefined_identifier | ||
_$HammerTime; | ||
|
||
mixin HammerTimeProps on UiProps { | ||
String somethingThatCanBeTouched; | ||
} | ||
|
||
mixin HammerTimeState on UiState {} | ||
|
||
class HammerTimeComponent extends UiStatefulComponent2<HammerTimeProps, HammerTimeState> { | ||
final mcHammer = 'cant touch this'; | ||
|
||
@override | ||
get defaultProps { | ||
return newProps() | ||
..somethingThatCanBeTouched = mcHammer; | ||
} | ||
|
||
@override | ||
getDerivedStateFromProps(Map nextProps, Map prevState) { | ||
final tNextProps = typedPropsFactory(nextProps); | ||
final tNextPropsJs = typedPropsFactoryJs(nextProps); | ||
final tPrevState = typedStateFactory(prevState); | ||
final tPrevStateJs = typedStateFactoryJs(prevState); | ||
|
||
if (props.somethingThatCanBeTouched == mcHammer) { | ||
return newState(); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
@override | ||
render() {} | ||
} |