-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor components to use React Hooks (#368)
* refactor About component * refactor ButtonLink component * Refactor CompleteError * refactor Footer to use hooks * refactor Home to use hooks * cleanup of references * refactor NotFound * address code review comments * destructure props in Button --------- Co-authored-by: sdzhong <[email protected]>
- Loading branch information
1 parent
16f7d87
commit 11eeec5
Showing
6 changed files
with
152 additions
and
184 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,14 +1,11 @@ | ||
import { Component } from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
class Button extends Component { | ||
render() { | ||
return ( | ||
<Link {...this.props} className="btn"> | ||
{this.props.children} | ||
</Link> | ||
); | ||
} | ||
function Button({ to, children }) { | ||
return ( | ||
<Link to={to} className="btn"> | ||
{children} | ||
</Link> | ||
); | ||
} | ||
|
||
export default Button; |
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
Oops, something went wrong.