Javascript 如何在React故事书中添加描述->;showInfo
我的React组件是一个动态组件。我在组件中添加了一个简单的PropTypes,但我想在每个属性中添加一个描述 以下是我的道具类型:Javascript 如何在React故事书中添加描述->;showInfo,javascript,reactjs,react-proptypes,storybook,Javascript,Reactjs,React Proptypes,Storybook,我的React组件是一个动态组件。我在组件中添加了一个简单的PropTypes,但我想在每个属性中添加一个描述 以下是我的道具类型: DynamicTable.propTypes={ tableCells:PropTypes.shape({ nameCells:PropTypes.array.isRequired, labelCells:PropTypes.array.isRequired }).要求, listRows:PropTypes.array.isRequired }看起来您需要使用内
DynamicTable.propTypes={
tableCells:PropTypes.shape({
nameCells:PropTypes.array.isRequired,
labelCells:PropTypes.array.isRequired
}).要求,
listRows:PropTypes.array.isRequired
}
看起来您需要使用内联注释和react docgen来填充此列
Input.propTypes = {
...DefaultProps.Input,
/** text, which is shown until the text is written */
placeholder: PropTypes.string,
/** size of the input, ordinary by default, could be `md` */
size: PropTypes.oneOf([undefined, 'md']),
/** mask for masked input pattern */
mask: MaskedInput.propTypes.mask,
/** all the rest params (e.g. onClick) */
rest: PropTypes.any,
};
参考资料:
babel-plugin-react-docgen (add to .babelrc "plugins": ["react-docgen"])