-
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.
Merge pull request #13 from Workiva/link-2020/pseudo-static-lifecycle…
…-cleanup PseudoStaticLifecycleDiagnostic cleanup
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
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
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() {} | ||
} |