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
Upgrade React and Use Hooks #1456
Upgrade React and Use Hooks #1456
Conversation
Nice! |
32f854f
to
e3741c7
Compare
|
||
import { featureReducer, featureReducerName } from './features'; | ||
import { monitoringReducer, monitoringReducerName } from './monitoring'; | ||
import k8sReducers from './module/k8s/k8s-reducers'; | ||
import UIReducers from './ui/ui-reducers'; | ||
|
||
/** |
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.
Curious if it would be helpful to make it a separate file here, redux-thunk.js
just to make this really really obvious (should anyone care).
I'm assuming the desired direction forward is to use |
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.
Nice work 👍
@@ -0,0 +1,43 @@ | |||
/* eslint-disable no-undef, no-unused-vars */ |
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.
Thank you for adding all of the new tests!
/** @type {React.SFC<{namespace: K8sResourceKind}>} */ | ||
export const PullSecret = (props) => { | ||
const [isLoading, setIsLoading] = React.useState(true); | ||
const [data, setData] = React.useState(undefined); |
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.
Hooks look great
/retest |
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.
Let's do it 👍
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alecmerdler, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Upgrade React to use hooks instead of class components. Refactors some components to be examples of how to use and test React hooks.
Changes
<DownloadButton>
,<CopyToClipboard>
,<PullSecret>
to be functional components withuseState()
and added tests<Timestamp>
to be stateless functional component and movedsetInterval()
logic to Reduxextend PromiseComponent
(rewritten in TypeScript)Next Steps
useSafetyFirst
custom hook to replaceextend SafetyFirst
Addresses https://jira.coreos.com/browse/CONSOLE-1287