mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 05:55:48 +08:00
Clarify transform for ViewStyleProps, generate union docs properly
This commit is contained in:
@@ -20,6 +20,7 @@ var slugify = require('slugify');
|
||||
|
||||
var styleReferencePattern = /^[^.]+\.propTypes\.style$/;
|
||||
|
||||
|
||||
var ComponentDoc = React.createClass({
|
||||
renderType: function(type) {
|
||||
if (type.name === 'enum') {
|
||||
@@ -33,6 +34,10 @@ var ComponentDoc = React.createClass({
|
||||
return '{' + Object.keys(type.value).map((key => key + ': ' + this.renderType(type.value[key]))).join(', ') + '}';
|
||||
}
|
||||
|
||||
if (type.name == 'union') {
|
||||
return type.value.map(this.renderType).join(', ');
|
||||
}
|
||||
|
||||
if (type.name === 'arrayOf') {
|
||||
return '[' + this.renderType(type.value) + ']';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user