This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to use functional components and hooksx
- Loading branch information
Showing
9 changed files
with
143 additions
and
126 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
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React, { Component } from 'react'; | ||
import { PropTypes, string } from 'prop-types'; | ||
import React from 'react'; | ||
import { PropTypes } from 'prop-types'; | ||
|
||
class Greeting extends Component { | ||
static propTypes = { | ||
name: PropTypes.string | ||
}; | ||
|
||
render() { | ||
return ( | ||
<strong>Hello, {this.props.name}!</strong> | ||
); | ||
} | ||
const Greeting = props => { | ||
const { name } = props; | ||
|
||
return ( | ||
<strong>Hello, {name}!</strong> | ||
); | ||
} | ||
|
||
export default Greeting; | ||
Greeting.propTypes = { | ||
name: PropTypes.string | ||
}; | ||
|
||
export default Greeting; |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.