typedoc-plugin-mark-react-functional-components
A plugin for TypeDoc to mark React functional components differently than ordinary functions.
See demo (built from this module ) or its screenshot:

Overview
Currently it is a simple head.end hook, adding:
- one
script- defines
windowloadevent - find functions, whose return type is given
reactReturnTypeoption - get its "title" name
- according to this name, get all relevant "title" elements
- add class
react-functional-componentto these relevant elements - find functions whose name matches
/^use[A-Z]/regexp and add classreact-hookto these elements
- defines
- one
style- adjust
.react-functional-component::beforeto display react icon - adjust
.react-hook::beforeto display react hook icon
- adjust
Installation
npm install --save-dev typedoc-plugin-mark-react-functional-componentsUsage
Plugin should be automaticall detected by TypeDoc.
If not, see TypeDoc plugin option.
Options:
reactReturnType(string | string[])Return type of react functional components.
Typically
Element,JSX.Elementor 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, defaulttrue)Mark react hooks or not.
Compatibility
tested with TypeDoc 0.22.15 and its default template.
Testing
npm run buildnpm run test- view
public/index.html
Contributing
is welcome :-)
- via the GitLab pages of the project
Bugs
Maintainer
License
TODO
- customization?
- different approach (e.g. full theme, more internal plugin, ...)?
- other occurrences (e.g. class method returning component)?
- ... ?