Skip to content

Commit

Permalink
upgrade to docusaurus-v2 (#233)
Browse files Browse the repository at this point in the history
Co-authored-by: swyx <shawnthe1@gmail.com>
  • Loading branch information
slorber and swyxio committed Jun 3, 2020
1 parent d7c02e3 commit 230fb01
Show file tree
Hide file tree
Showing 38 changed files with 5,897 additions and 3,111 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Expand Up @@ -107,6 +107,9 @@ dist
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# Idea / Jetbrains IDE
.idea

# yarn v2

.yarn/cache
Expand All @@ -116,6 +119,11 @@ dist

# Miscellaneous
.history

# Docusaurus files
website/build
website/.docusaurus
website/.cache-loader

# Local Netlify folder
.netlify
.netlify
2 changes: 1 addition & 1 deletion docs/advanced/guides/extract-props.md
@@ -1,6 +1,6 @@
---
id: extract_props
title: Props: Extracting Prop Types of a Component
title: "Props: Extracting Prop Types of a Component"
---

_(Contributed by [@ferdaber](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/issues/63))_
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/handling-exceptions.md
@@ -1,5 +1,5 @@
---
id: handling_exception
id: handling_exceptions
title: Handling Exceptions
---

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/props-must-pass-both.md
@@ -1,6 +1,6 @@
---
id: props_one_other_not_both
title: Props: Must Pass Both
title: "Props: Must Pass Both"
---

```tsx
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/props-one-other-not-both.md
@@ -1,6 +1,6 @@
---
id: props_one_other_not_both
title: Props: One or the Other but not Both
title: "Props: One or the Other but not Both"
---

Use the `in` keyword, function overloading, and union types to make components that take either one or another sets of props, but not both:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/props-optionally-pass-one.md
@@ -1,6 +1,6 @@
---
id: props_optionally_pass_one
title: Props: Can Optionally Pass One Only If the Other Is Passed
title: "Props: Can Optionally Pass One Only If the Other Is Passed"
---

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).
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/third-party-libs.md
@@ -1,6 +1,6 @@
---
id: third_party_libs
title: Props: Third Party Libraries
title: "Props: Third Party Libraries"
---

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.
2 changes: 1 addition & 1 deletion docs/advanced/misc-concerns.md
@@ -1,6 +1,6 @@
---
id: misc_concerns
title: Section 3: Misc. Concerns
title: "Section 3: Misc. Concerns"
sidebar_label: Misc. Concerns
---

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/patterns.md
@@ -1,6 +1,6 @@
---
id: patterns
title: Section 2: Useful Patterns by TypeScript Version
title: "Section 2: Useful Patterns by TypeScript Version"
sidebar_label: Useful Patterns by TypeScript Version
---

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/types-react-ap.md
@@ -1,7 +1,7 @@
---
id: types_react_api
title: Section 4: @types/react and @types/react-dom APIs
sidebar_label: @types/react and @types/react-dom APIs
title: "Section 4: @types/react and @types/react-dom APIs"
sidebar_label: "@types/react and @types/react-dom APIs"
---

The `@types` typings export both "public" types meant for your use as well as "private" types that are for internal use.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/utility-types.md
@@ -1,6 +1,6 @@
---
id: utility_types
title: Section 0: Utility Types
title: "Section 0: Utility Types"
sidebar_label: Utility Types
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/getting-started/class-components.md
Expand Up @@ -33,7 +33,7 @@ class App extends React.Component<MyProps, MyState> {
Don't forget that you can export/import/extend these types/interfaces for reuse.

<details>
<summary><b>Why annotate `state` twice?</b></summary>
<summary><b>Why annotate <code>state</code> twice?</b></summary>

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.

Expand Down
3 changes: 2 additions & 1 deletion docs/basic/getting-started/react-prop-type-examples.md
Expand Up @@ -24,7 +24,8 @@ Quote [@ferdaber](https://github.com/typescript-cheatsheets/react-typescript-che

- `JSX.Element` -> Return value of `React.createElement`
- `React.ReactNode` -> Return value of a component
</details>

</details>

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

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/non-ts-files.md
@@ -1,6 +1,6 @@
---
id: non_ts_files
title: Troubleshooting Handbook: Images and other non-TS/TSX files
title: "Troubleshooting Handbook: Images and other non-TS/TSX files"
sidebar_label: Images and other non-TS/TSX files
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/operators.md
@@ -1,6 +1,6 @@
---
id: operators
title: Troubleshooting Handbook: Operators
title: "Troubleshooting Handbook: Operators"
sidebar_label: Operators
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/ts-config.md
@@ -1,6 +1,6 @@
---
id: tsconfig
title: Troubleshooting Handbook: tsconfig.json
title: "Troubleshooting Handbook: tsconfig.json"
sidebar_label: tsconfig.json
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/types.md
@@ -1,6 +1,6 @@
---
id: types
title: Troubleshooting Handbook: Types
title: "Troubleshooting Handbook: Types"
sidebar_label: Types
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/utilities.md
@@ -1,6 +1,6 @@
---
id: utilities
title: Troubleshooting Handbook: Utilities
title: "Troubleshooting Handbook: Utilities"
sidebar_label: Utilities
---

Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/excluding-props.md
@@ -1,7 +1,7 @@
---
id: excluding_props
sidebar_label: Excluding Props
title: Section 2: Excluding Props
title: "Section 2: Excluding Props"
---

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.
Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/full-example.md
@@ -1,7 +1,7 @@
---
id: full_example
sidebar_label: Full HOC Example
title: Section 0: Full HOC Example
title: "Section 0: Full HOC Example"
---

> 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.
Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/react-hoc-docs.md
@@ -1,7 +1,7 @@
---
id: react_hoc_docs
sidebar_label: React HOC docs in TypeScript
title: Section 1: React HOC docs in TypeScript
title: "Section 1: React HOC docs in TypeScript"
---

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.
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Expand Up @@ -6,10 +6,10 @@
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "build/react-typescript-cheatsheet"
publish = "build"

# Default build command.
command = "yarn build"

# Directory with the serverless Lambda functions to deploy to AWS.
# functions = "project/functions/"
# functions = "project/functions/"

0 comments on commit 230fb01

Please sign in to comment.