-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to customize prop-types module path
- Loading branch information
cookieranger
committed
Apr 14, 2017
1 parent
c2172ad
commit 4f4ee70
Showing
4 changed files
with
207 additions
and
163 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
17 changes: 17 additions & 0 deletions
17
transforms/__testfixtures__/React-PropTypes-to-prop-types/module-name.input.js
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,17 @@ | ||
const React = require('React'); | ||
|
||
class ClassComponent extends React.Component { | ||
static propTypes = { | ||
text: React.PropTypes.string.isRequired, | ||
}; | ||
render() { | ||
return <div>{this.props.text}</div>; | ||
} | ||
} | ||
|
||
function FunctionalComponent (props) { | ||
return <div>{props.text}</div>; | ||
} | ||
FunctionalComponent.propTypes = { | ||
text: React.PropTypes.string.isRequired, | ||
}; |
18 changes: 18 additions & 0 deletions
18
transforms/__testfixtures__/React-PropTypes-to-prop-types/module-name.output.js
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,18 @@ | ||
const PropTypes = require('PropTypes'); | ||
const React = require('React'); | ||
|
||
class ClassComponent extends React.Component { | ||
static propTypes = { | ||
text: PropTypes.string.isRequired, | ||
}; | ||
render() { | ||
return <div>{this.props.text}</div>; | ||
} | ||
} | ||
|
||
function FunctionalComponent (props) { | ||
return <div>{props.text}</div>; | ||
} | ||
FunctionalComponent.propTypes = { | ||
text: PropTypes.string.isRequired, | ||
}; |
Oops, something went wrong.