You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ npm install -g react-docgen
16
16
17
17
## CLI
18
18
19
-
Installing the module adds a `react-docgen` executable which allows you do convert
19
+
Installing the module adds a `react-docgen` executable which allows you to convert
20
20
a single file, multiple files or an input stream. We are trying to make the
21
21
executable as versatile as possible so that it can be integrated into many
22
22
workflows.
@@ -63,8 +63,7 @@ As with the CLI, this will look for the exported component created through `Reac
63
63
| -------------- | ------ | --------------- |
64
64
| source | string | The source text |
65
65
| resolver | function | A function of the form `(ast: ASTNode, recast: Object) => (NodePath|Array<NodePath>)`. Given an AST and a reference to recast, it returns an (array of) NodePath which represents the component definition. |
66
-
| handlers | Array\<function\> | An array of functions of the form `(documentation: Documentation, definition: NodePath) => void`. Each function is called with a `Documentation` object and a reference to the component definition as returned by `resolver`. Handlers extract relevant information from the definition and augment `documentation`.
67
-
66
+
| handlers | Array\<function\>| An array of functions of the form `(documentation: Documentation, definition: NodePath) => void`. Each function is called with a `Documentation` object and a reference to the component definition as returned by `resolver`. Handlers extract relevant information from the definition and augment `documentation`. |
68
67
69
68
#### resolver
70
69
@@ -96,8 +95,7 @@ For example, while the `propTypesHandler` expects the prop types definition to b
96
95
97
96
## Guidelines for default resolvers and handlers
98
97
99
-
- Modules have to export a single component, and only that component is
100
-
analyzed.
98
+
- Modules have to export a single component, and only that component is analyzed.
101
99
- When using `React.createClass`, the component definition (the value passed to it) must resolve to an object literal.
102
100
- When using classes, the class must either `extend React.Component`*or* define a `render()` method.
103
101
-`propTypes` must be an object literal or resolve to an object literal in the same file.
0 commit comments