Skip to content

Commit

Permalink
fix(docz-example-typescript): add scheduler dep and docs #1020
Browse files Browse the repository at this point in the history
* fix(docz-example-typescript): add scheduler dep and docs

* fix(docz-example-flow): add @babel/preset-flow with onCreateBabelConfig

* docs(docz-example-flow): add setup instructions
  • Loading branch information
rakannimer committed Aug 27, 2019
1 parent a4f9203 commit fbc8e89
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 15 deletions.
21 changes: 21 additions & 0 deletions examples/flow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Flow Docz example

## Download

```sh
curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/flow
mv flow docz-flow-example
cd docz-flow-example
```

## Setup

```sh
yarn # npm i
```

## Run

```sh
yarn dev # npm run dev
```
5 changes: 5 additions & 0 deletions examples/flow/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exports.onCreateBabelConfig = ({ actions }) => {
actions.setBabelPreset({
name: `@babel/preset-flow`,
})
}
16 changes: 2 additions & 14 deletions examples/flow/src/components/Alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Alert
menu: Components
---

import { Playground, Props } from 'docz'
import { Alert } from './Alert'
import { Playground, Props } from "docz";
import { Alert } from "./Alert";

# Alert

Expand All @@ -26,15 +26,3 @@ import { Alert } from './Alert'
<Alert kind="negative">Some message</Alert>
<Alert kind="warning">Some message</Alert>
</Playground>

## Use with children as a function

<Playground>
{() => {
const message = 'Hello world'

return (
<Alert>{message}</Alert>
)
}}
</Playground>
21 changes: 21 additions & 0 deletions examples/typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Typescript Docz example

## Download manually

```sh
curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/typescript
mv typescript docz-typescript-example
cd docz-typescript-example
```

## Setup

```sh
yarn # npm i
```

## Run

```sh
yarn dev # npm run dev
```
3 changes: 2 additions & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"@emotion/core": "^10.0.14",
"@emotion/styled": "^10.0.14",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react-dom": "^16.8.6",
"scheduler": "^0.15.0"
},
"devDependencies": {
"@types/react": "^16.8.23",
Expand Down

0 comments on commit fbc8e89

Please sign in to comment.