New features
Add JSDoc @component
annotation for Styled Components 💅
Finally you can use Styled Components without any (well, almost) hacks:
import React from 'react'
import styled from 'styled-components'
const SalmonButton = styled.button`
background-color: salmon;
border: 1px solid indianred;
color: snow;
`
/** @component */
export default SalmonButton
Include unrecognized components in the style guide
Components that react-docgen does not recognize as React components will still be included in the style guide. The displayName
for such components is guessed based on the file name.
(#672 by @jfschwarz)
Allow ignore
to be specified at section level
module.exports = {
sections: [
{
name: 'UI Components',
content: 'docs/ui.md',
components: 'lib/components/*.js',
ignore: '**/components/Button.js',
}
]
}
Support @return
for PropTypes.func
documentation
Button.propTypes = {
/**
* Gets called when the user clicks on the button
*
* @param {SyntheticEvent} event The React event
* @return {SyntheticEvent} The onClick event
*/
onClick: PropTypes.func
};
Tweak CLI a bit
Bug fixes and small stuff
- Clear console only on hot reload (#723)
- Use
webpack.DefinePlugin
as recommended by webpack docs (#726) - Add
buttonTextTransform
variable to theme (#728, #702 by @jmurret) - Fix incorrect cursor on headers (#727, #703 by @jmurret)
- Improve the sidebar scroll UX for touch devices (#721 by @probablyup)
- Update to new version of markdown-to-jsx which is significantly smaller (#725 by @probablyup)
- Change code tab button caption from “Code” to “View Code” (#697, #693 by @aversini)
- Allow overriding default webpack dev server options (#690 by @jure)
- Reload dev server when assets change (#685, #682 by @esturcke)
- Pass
NODE_ENV
to webpack's definePlugin (#679, #677 by @WaldoJeffers) - Fix navigation between list and isolated mode issues (#663, #467)
- Correct whitespace around error messages with noeditor modifier (#673, #576, #667)
- Correct URL of the isolated mode of the first example (index = 0) (#663)
- Initialize logger before config validation (fixes previously hidden config warning)
- Disable clean-webpack-plugin debug info unless we are in verbose mode