-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from diegolanda/master
Added PureComponent do docgenConverter and examples
- Loading branch information
Showing
4 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
examples/react-styleguidist-example/components/ConstExport.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as React from 'react'; | ||
|
||
/** | ||
* Row properties. | ||
*/ | ||
export interface IRowProps { | ||
/** prop1 description */ | ||
prop1?: string; | ||
/** prop2 description */ | ||
prop2: number; | ||
/** | ||
* prop3 description | ||
*/ | ||
prop3: () => void; | ||
/** prop4 description */ | ||
prop4: 'option1' | 'option2' | "option3"; | ||
} | ||
|
||
/** | ||
* test | ||
* | ||
*/ | ||
export const test = (one: number) => { | ||
return one; | ||
} | ||
|
||
export const myObj = { | ||
foo: 'bar', | ||
} | ||
|
||
/** | ||
* Form row. | ||
*/ | ||
export const ConstExportRow = (props: IRowProps) => { | ||
const innerFunc = (props: IRowProps) => { | ||
return <span>Inner Func</span> | ||
}; | ||
const innerNonExportedFunc = (props: IRowProps) => { | ||
return <span>Inner Func</span> | ||
}; | ||
return <div>Test</div>; | ||
}; | ||
|
||
const nonExportedFunc = (props: IRowProps) => { | ||
return <div>No Export</div> | ||
}; | ||
|
||
export default ConstExportRow; |
29 changes: 29 additions & 0 deletions
29
examples/react-styleguidist-example/components/PureRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react'; | ||
|
||
/** | ||
* Row properties. | ||
*/ | ||
export interface IRowProps { | ||
/** prop1 description */ | ||
prop1?: string; | ||
/** prop2 description */ | ||
prop2: number; | ||
/** | ||
* prop3 description | ||
*/ | ||
prop3: () => void; | ||
/** prop4 description */ | ||
prop4: 'option1' | 'option2' | "option3"; | ||
} | ||
|
||
/** | ||
* Form row. | ||
*/ | ||
export class PureRow extends React.PureComponent<IRowProps, {}> { | ||
|
||
render() { | ||
return <div>Test</div>; | ||
} | ||
}; | ||
|
||
export default PureRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters