-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1055 from wellyshen/feature/code-refactor
Pass props down to Home component & Refine types
- Loading branch information
Showing
10 changed files
with
30 additions
and
32 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
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,15 +1,15 @@ | ||
import loadable from "@loadable/component"; | ||
|
||
import { Loading, ErrorBoundary } from "../../components"; | ||
import { loadData } from "./Home"; | ||
import { Props, loadData } from "./Home"; | ||
|
||
const Home = loadable(() => import("./Home"), { | ||
fallback: <Loading />, | ||
}); | ||
|
||
export default (): JSX.Element => ( | ||
export default (props: Props): JSX.Element => ( | ||
<ErrorBoundary> | ||
<Home /> | ||
<Home {...props} /> | ||
</ErrorBoundary> | ||
); | ||
export { loadData }; |
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
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ import UserInfo from "../UserInfo"; | |
|
||
describe("<UserInfo />", () => { | ||
const mockData = { | ||
id: 1, | ||
id: "1", | ||
name: "Welly", | ||
phone: "+886 0970...", | ||
email: "[email protected]", | ||
|
@@ -20,6 +20,8 @@ describe("<UserInfo />", () => { | |
const { container } = render( | ||
<ProviderWithStore> | ||
<MemoryRouter> | ||
{/* | ||
@ts-expect-error */} | ||
<UserInfo match={{ params: { id } }} /> | ||
</MemoryRouter> | ||
</ProviderWithStore> | ||
|
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