A plugin for TypeDoc to mark React functional components differently than ordinary functions
A plugin for TypeDoc to mark
React
functional components
differently than ordinary functions.
See demo
(built from
this module
) or its screenshot:
!demo
head.end hook, adding:scriptwindow load eventreactReturnType optionreact-functional-component to these relevant elements/^use[A-Z]/ regexp and add class react-hook to these elementsstyle.react-functional-component::before to display react icon.react-hook::before to display react hook icon
npm install --save-dev typedoc-plugin-mark-react-functional-components
`Usage
Plugin should be automaticall detected by TypeDoc.
If not, see TypeDoc plugin option.$3
-
reactReturnType (string | string[]) Return type of react functional components.
Typically
Element, JSX.Element or similar.-
notReactHook (string | string[], optional) By default, mark all functions mathing
/^use[A-Z]/ as react hooks.
This option define names, which should be excluded.-
markReactHooks (boolean, optional, default true) Mark react hooks or not.
Compatibility
tested with TypeDoc 0.22.15 and its default template.Testing
- npm run build
- npm run test
- view public/index.html`#### Bugs
issue tracker