-
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.
Adding support for default exports (#58)
* Default export does not work - fixed
- Loading branch information
Showing
15 changed files
with
154 additions
and
26 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
31 changes: 31 additions & 0 deletions
31
src/__tests__/data/ColumnWithDefaultAnonymousExportOnly.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,31 @@ | ||
import * as React from 'react'; | ||
|
||
/** | ||
* Column properties. | ||
*/ | ||
export interface IColumnProps { | ||
/** prop1 description */ | ||
prop1?: string; | ||
/** prop2 description */ | ||
prop2: number; | ||
/** | ||
* prop3 description | ||
*/ | ||
prop3: () => void; | ||
/** prop4 description */ | ||
prop4: 'option1' | 'option2' | "option3"; | ||
} | ||
|
||
/** | ||
* ColumnWithDefaultAnonymousExportOnly description | ||
*/ | ||
export default class extends React.Component<IColumnProps, {}> { | ||
public static defaultProps: Partial<IColumnProps> = { | ||
prop1: 'prop1' | ||
}; | ||
|
||
render() { | ||
const {prop1} = this.props; | ||
return <div>{prop1}</div>; | ||
} | ||
} |
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,33 @@ | ||
import * as React from 'react'; | ||
|
||
/** | ||
* Column properties. | ||
*/ | ||
export interface IColumnProps { | ||
/** prop1 description */ | ||
prop1?: string; | ||
/** prop2 description */ | ||
prop2: number; | ||
/** | ||
* prop3 description | ||
*/ | ||
prop3: () => void; | ||
/** prop4 description */ | ||
prop4: 'option1' | 'option2' | "option3"; | ||
} | ||
|
||
/** | ||
* Column description | ||
*/ | ||
class Column extends React.Component<IColumnProps, {}> { | ||
public static defaultProps: Partial<IColumnProps> = { | ||
prop1: 'prop1' | ||
}; | ||
|
||
render() { | ||
const {prop1} = this.props; | ||
return <div>{prop1}</div>; | ||
} | ||
} | ||
|
||
export default Column; |
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,31 @@ | ||
import * as React from 'react'; | ||
|
||
/** | ||
* Column properties. | ||
*/ | ||
export interface IColumnProps { | ||
/** prop1 description */ | ||
prop1?: string; | ||
/** prop2 description */ | ||
prop2: number; | ||
/** | ||
* prop3 description | ||
*/ | ||
prop3: () => void; | ||
/** prop4 description */ | ||
prop4: 'option1' | 'option2' | "option3"; | ||
} | ||
|
||
/** | ||
* ColumnWithDefaultExportOnly description | ||
*/ | ||
export default class Column extends React.Component<IColumnProps, {}> { | ||
public static defaultProps: Partial<IColumnProps> = { | ||
prop1: 'prop1' | ||
}; | ||
|
||
render() { | ||
const {prop1} = this.props; | ||
return <div>{prop1}</div>; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -33,6 +33,4 @@ export const FlippableImage = (props: Props) => { | |
{...rest} | ||
/> | ||
); | ||
}; | ||
|
||
export default FlippableImage; | ||
}; |
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 |
---|---|---|
|
@@ -19,5 +19,3 @@ export class Row extends React.PureComponent<IRowProps, {}> { | |
return <div>Test</div>; | ||
} | ||
}; | ||
|
||
export default Row; |
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 |
---|---|---|
|
@@ -69,5 +69,3 @@ export class Zoomable extends React.PureComponent<Props, State> { | |
); | ||
} | ||
} | ||
|
||
export default Zoomable; |
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 |
---|---|---|
|
@@ -17,4 +17,3 @@ StatelessWithDefaultProps.defaultProps = { | |
sampleProp: 'test' | ||
}; | ||
|
||
export default StatelessWithDefaultProps; |
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