-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #4971 from Nemvts/4955-storysource-flow-parser
Feat: Add support for Flow to @addons/storysource
- Loading branch information
Showing
6 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
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,35 @@ | ||
// @flow | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { withInfo } from '@storybook/addon-info'; | ||
|
||
import TableComponent from '../components/TableComponent'; | ||
|
||
import type { JssClasses } from '../types'; | ||
|
||
type State = { | ||
value: any, | ||
}; | ||
|
||
type Props = { | ||
classes: JssClasses, | ||
name: string, | ||
}; | ||
|
||
class Table extends React.Component<Props, State> { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
value: undefined, | ||
}; | ||
} | ||
|
||
state: State; | ||
|
||
render() { | ||
return <TableComponent />; | ||
} | ||
} | ||
|
||
const stories = storiesOf('Table', module); | ||
stories.add('Flow Class', withInfo('Lorum Ipsum Nem')(() => <Table />)); |
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
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
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,9 @@ | ||
import parseFlow from 'prettier/parser-flow'; | ||
|
||
function parse(source) { | ||
return parseFlow.parsers.flow.parse(source); | ||
} | ||
|
||
export default { | ||
parse, | ||
}; |