Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private renderTypeColumn = (prop): JSX.Element => {
if (prop.flowType) {
return {this.renderFlowType( getType( prop ) )}
}
return {this.renderType( getType (prop ) )}
}
}
private renderUnion = ( prop ): JSX.Element => {
if ( !Array.isArray( getType( prop ).value ) ) {
return <span>{getType(prop).value}</span>
}
const values = getType( prop ).value.map( ( value, index ) => (
{this.renderType( value )}
))
return (
<span>
One of type:{' '}
{values}
</span>
)
}
private renderTypeColumn = (prop): JSX.Element => {
if (prop.flowType) {
return {this.renderFlowType( getType( prop ) )}
}
return {this.renderType( getType (prop ) )}
}
}
private renderExtra = ( prop ): JSX.Element | JSX.Element[] => {
const type = getType( prop )
if ( !type ) return null
switch ( type.name ) {
case 'enum':
return this.renderEnum( prop )
case 'union':
return this.renderUnion( prop )
case 'shape':
return this.renderShape( prop.type.value )
case 'arrayOf':
if ( type.value.name === 'shape' ) {
return this.renderShape( prop.type.value.value )
}
return null
case 'objectOf':