Last active
July 24, 2019 01:03
-
-
Save methodbox/34e5db3831ffa1ca8ef78608807ce703 to your computer and use it in GitHub Desktop.
Get Started with TypeScript - Part 2 - State assigned to state
This file contains hidden or 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
type State = { | |
appTitle: string; | |
launchImg: string; | |
rocketName: string; | |
missionName: string; | |
missionLogo: string; | |
missionDetails: string; | |
missionSuccess: boolean; | |
flightNumber: number; | |
missionId: string; | |
launchDate: string; | |
payloadSize: number; | |
ships: Array<string>; | |
isShowingMissionData: boolean; | |
}; | |
export default class RocketApp extends React.Component<{}, State> { | |
state: State = { | |
appTitle: 'SpaceX Launches', | |
launchImg: '', | |
rocketName: '', | |
missionName: '', | |
missionLogo: '', | |
missionDetails: '', | |
missionSuccess: false, | |
flightNumber: 0, | |
missionId: '', | |
launchDate: '', | |
payloadSize: 0, | |
ships: [], | |
isShowingMissionData: false, | |
}; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment