Skip to content

Commit 230fb01

Browse files
slorberswyxio
andauthored
upgrade to docusaurus-v2 (#233)
Co-authored-by: swyx <shawnthe1@gmail.com>
1 parent d7c02e3 commit 230fb01

38 files changed

+5897
-3111
lines changed

‎.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ dist
107107
# Stores VSCode versions used for testing VSCode extensions
108108
.vscode-test
109109

110+
# Idea / Jetbrains IDE
111+
.idea
112+
110113
# yarn v2
111114

112115
.yarn/cache
@@ -116,6 +119,11 @@ dist
116119

117120
# Miscellaneous
118121
.history
122+
123+
# Docusaurus files
119124
website/build
125+
website/.docusaurus
126+
website/.cache-loader
127+
120128
# Local Netlify folder
121-
.netlify
129+
.netlify

‎docs/advanced/guides/extract-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: extract_props
3-
title: Props: Extracting Prop Types of a Component
3+
title: "Props: Extracting Prop Types of a Component"
44
---
55

66
_(Contributed by [@ferdaber](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/issues/63))_

‎docs/advanced/guides/handling-exceptions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
id: handling_exception
2+
id: handling_exceptions
33
title: Handling Exceptions
44
---
55

‎docs/advanced/guides/props-must-pass-both.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: props_one_other_not_both
3-
title: Props: Must Pass Both
3+
title: "Props: Must Pass Both"
44
---
55

66
```tsx

‎docs/advanced/guides/props-one-other-not-both.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: props_one_other_not_both
3-
title: Props: One or the Other but not Both
3+
title: "Props: One or the Other but not Both"
44
---
55

66
Use the `in` keyword, function overloading, and union types to make components that take either one or another sets of props, but not both:

‎docs/advanced/guides/props-optionally-pass-one.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: props_optionally_pass_one
3-
title: Props: Can Optionally Pass One Only If the Other Is Passed
3+
title: "Props: Can Optionally Pass One Only If the Other Is Passed"
44
---
55

66
Say you want a Text component that gets truncated if `truncate` prop is passed but expands to show the full text when `expanded` prop is passed (e.g. when the user clicks the text).
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: third_party_libs
3-
title: Props: Third Party Libraries
3+
title: "Props: Third Party Libraries"
44
---
55

66
Sometimes DefinitelyTyped can get it wrong, or isn't quite addressing your use case. You can declare your own file with the same interface name. TypeScript will merge interfaces with the same name.

‎docs/advanced/misc-concerns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: misc_concerns
3-
title: Section 3: Misc. Concerns
3+
title: "Section 3: Misc. Concerns"
44
sidebar_label: Misc. Concerns
55
---
66

‎docs/advanced/patterns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: patterns
3-
title: Section 2: Useful Patterns by TypeScript Version
3+
title: "Section 2: Useful Patterns by TypeScript Version"
44
sidebar_label: Useful Patterns by TypeScript Version
55
---
66

‎docs/advanced/types-react-ap.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: types_react_api
3-
title: Section 4: @types/react and @types/react-dom APIs
4-
sidebar_label: @types/react and @types/react-dom APIs
3+
title: "Section 4: @types/react and @types/react-dom APIs"
4+
sidebar_label: "@types/react and @types/react-dom APIs"
55
---
66

77
The `@types` typings export both "public" types meant for your use as well as "private" types that are for internal use.

‎docs/advanced/utility-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: utility_types
3-
title: Section 0: Utility Types
3+
title: "Section 0: Utility Types"
44
sidebar_label: Utility Types
55
---
66

‎docs/basic/getting-started/class-components.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class App extends React.Component<MyProps, MyState> {
3333
Don't forget that you can export/import/extend these types/interfaces for reuse.
3434

3535
<details>
36-
<summary><b>Why annotate `state` twice?</b></summary>
36+
<summary><b>Why annotate <code>state</code> twice?</b></summary>
3737

3838
It isn't strictly necessary to annotate the `state` class property, but it allows better type inference when accessing `this.state` and also initializing the state.
3939

‎docs/basic/getting-started/react-prop-type-examples.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Quote [@ferdaber](https://github.com/typescript-cheatsheets/react-typescript-che
2424

2525
- `JSX.Element` -> Return value of `React.createElement`
2626
- `React.ReactNode` -> Return value of a component
27-
</details>
27+
28+
</details>
2829

2930
[More discussion: Where ReactNode does not overlap with JSX.Element](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/issues/129)
3031

‎docs/basic/troubleshooting/non-ts-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: non_ts_files
3-
title: Troubleshooting Handbook: Images and other non-TS/TSX files
3+
title: "Troubleshooting Handbook: Images and other non-TS/TSX files"
44
sidebar_label: Images and other non-TS/TSX files
55
---
66

‎docs/basic/troubleshooting/operators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: operators
3-
title: Troubleshooting Handbook: Operators
3+
title: "Troubleshooting Handbook: Operators"
44
sidebar_label: Operators
55
---
66

‎docs/basic/troubleshooting/ts-config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: tsconfig
3-
title: Troubleshooting Handbook: tsconfig.json
3+
title: "Troubleshooting Handbook: tsconfig.json"
44
sidebar_label: tsconfig.json
55
---
66

‎docs/basic/troubleshooting/types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: types
3-
title: Troubleshooting Handbook: Types
3+
title: "Troubleshooting Handbook: Types"
44
sidebar_label: Types
55
---
66

‎docs/basic/troubleshooting/utilities.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: utilities
3-
title: Troubleshooting Handbook: Utilities
3+
title: "Troubleshooting Handbook: Utilities"
44
sidebar_label: Utilities
55
---
66

‎docs/hoc/excluding-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: excluding_props
33
sidebar_label: Excluding Props
4-
title: Section 2: Excluding Props
4+
title: "Section 2: Excluding Props"
55
---
66

77
This is covered in passing in Section 1 but we focus on it here as it is such a common issue. HOCs often inject props to premade components. The problem we want to solve is having the HOC-wrapped-component exposing a type that reflects the reduced surface area of props - without manually retyping the HOC every time. This involves some generics, fortunately with some helper utilities.

‎docs/hoc/full-example.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: full_example
33
sidebar_label: Full HOC Example
4-
title: Section 0: Full HOC Example
4+
title: "Section 0: Full HOC Example"
55
---
66

77
> This is an HOC example for you to copy and paste. If you certain pieces don't make sense for you, head to [Section 1](#section-1-react-hoc-docs-in-typescript) to get a detailed walkthrough via a complete translation of the React docs in TypeScript.

‎docs/hoc/react-hoc-docs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: react_hoc_docs
33
sidebar_label: React HOC docs in TypeScript
4-
title: Section 1: React HOC docs in TypeScript
4+
title: "Section 1: React HOC docs in TypeScript"
55
---
66

77
In this first section we refer closely to [the React docs on HOCs](https://reactjs.org/docs/higher-order-components.html) and offer direct TypeScript parallels.

‎netlify.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# Directory (relative to root of your repo) that contains the deploy-ready
77
# HTML files and assets generated by the build. If a base directory has
88
# been specified, include it in the publish directory path.
9-
publish = "build/react-typescript-cheatsheet"
9+
publish = "build"
1010

1111
# Default build command.
1212
command = "yarn build"
1313

1414
# Directory with the serverless Lambda functions to deploy to AWS.
15-
# functions = "project/functions/"
15+
# functions = "project/functions/"

0 commit comments

Comments
 (0)