Skip to content

Commit

Permalink
Docs: Simplify third-parties guide a bit, fix heading
Browse files Browse the repository at this point in the history
  • Loading branch information
sapegin committed Jun 28, 2017
1 parent f6bf46f commit 1554e76
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions docs/Thirdparties.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ export default class Wrapper extends Component {

### Relay

Based on @mikberg’s [blog post](https://medium.com/@mikaelberg/writing-simple-unit-tests-with-relay-707f19e90129).

#### 1. Mock out Relay

You’ll need the content from [this Gist](https://gist.github.com/mikberg/07b4006e22aacf31ffe6) for your mocked-out Relay replacement.
**First, mock out Relay.** You’ll need the content from [this Gist](https://gist.github.com/mikberg/07b4006e22aacf31ffe6) for your mocked-out Relay replacement.

```js
// styleguide.config.js
Expand All @@ -120,9 +116,7 @@ import Relay from 'real-react-relay';
// Copy contents from https://gist.github.com/mikberg/07b4006e22aacf31ffe6
```

#### 2. Provide sample data to your React components

You’ll probably want to massage actual results from your GraphQL backend, and make it available to the examples:
**Second, provide sample data to your React components** to be able to message actual results from your GraphQL backend:

```js
// styleguide.config.js
Expand All @@ -148,7 +142,10 @@ module.exports = {
<MyComponent object={sample.object} />
```

## How to use React Styleguidist with Styled Components?
*Based on @mikberg’s [blog post](https://medium.com/@mikaelberg/writing-simple-unit-tests-with-relay-707f19e90129).*


### Styled Components

The [recommended way](https://github.com/styleguidist/react-styleguidist/issues/37#issuecomment-263502454) of using [Styled Components](https://styled-components.com/) is like this:

Expand Down

0 comments on commit 1554e76

Please sign in to comment.