-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added code snippet for react-redux connected components #501
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @matthewnitschke-wk!
Couple of minor things:
- In the other snippets we omit the type on the left side of the
defaultProps
getter since it isn't necessary for the Dart type system to infer its type fromsuper
(Map
). - The return type of
render
is actuallydynamic
(render can returnString
,num
,bool
,FragmentElement
, orReactElement
) - but it should be omitted altogether for the purpose of the snippet since that's how it is in all the other ones. - The indentation of the lines within the component class should be 2 space indents, not 4 space continuations.
- The default value for the
$MyState$
variable should not be the same as the component name, IMO... maybe something like "SomeReduxStoreState"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
+10 for the WebStorm snippet
@kealjones-wk can you take the VsCode one for a spin when you have a chance?
@@ -42,3 +42,11 @@ | |||
<option name="DART" value="true" /> | |||
</context> | |||
</template> | |||
<template name="orStlessConnect" value="import 'package:over_react/over_react.dart'; import 'package:over_react/over_react_redux.dart'; part '$FileName$.over_react.g.dart'; UiFactory<$MyComponent$Props> $MyComponent$ = connect<$SomeReduxStoreState$, $MyComponent$Props>( mapStateToProps: (state) => ($MyComponent$()), mapDispatchToProps: (dispatch) => ($MyComponent$()), )(_$$$MyComponent$); // ignore: undefined_identifier mixin $MyComponent$Props on UiProps {} class $MyComponent$Component extends UiComponent2<$MyComponent$Props> { @override get defaultProps => (newProps()); @override render() { } }" description="Creates a stateless and connected over_react component" toReformat="false" toShortenFQNames="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+10
@Workiva/release-management-pp Thanks for the contribution, @matthewnitschke-wk! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from RM
Motivation
Added a
orStlessConnect
snippet to generate the following:Changes
Added above snippet for vscode and intelij
Release Notes
Add react-redux connected component snippets for both vscode and intlij
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: