github styleguidist/react-styleguidist v11.0.0

latest releases: v13.1.2, v13.1.1, v13.1.0...
4 years ago

Breaking changes

TypeScript is supported out of the box

We’ve upgraded react-docgen to 5.0.0, which adds TypeScript support out of the box. The are some limitations, so you may still need react-docgen-typescript — see docs for more details.

(#1500, #1354 by @thecodejack)

Fenced code blocks in Markdown with tags typescript, ts and tsx are rendered as an interactive playground. Use the static modifier to render only the source code.

(#1543 by @mitsuruog)

Prefer default exports over named exports

When your component has both default and named exports, Styleguidist will use the default export. This is a bug fix but may break some style guides.

import React from 'react';
import styled from 'styled-components';

export const C: React.FC = () => {
  ...
}

const StyledC = styled(C)``;

export default StyledC;

(#1504 by @Lazyuki)

Remove initialState/setState/state

Use React’s useState hook instead:

- initialState = { count: 42 };
- <Button onClick={() => setState({ count: state.count + 1 })}>{state.count}</Button>
+ const [count, setCount] = React.useState(42);
+ <Button onClick={() => setCount(count + 1)}>{count}</Button>

(#1501 by @thecodejack)

Drop Node.js 8 support

The minimum supported version on Node.js is 10.

(#1545)

New features

Don't miss a new react-styleguidist release

NewReleases is sending notifications on new releases.