Repository URL to install this package:
Version:
0.14.1 ▾
|
/**
* @fileoverview this is a ts example for validation and showing autocomplete
* @todo need to import commonState
*/
import { toCommonState } from 'src/state/common'
import { IObservable } from 'xmobx/mobx'
import React from 'react'
interface State extends IObservable {
isVisible: boolean
}
interface Props {
text: string
url: string
children?: any
}
class Eh extends React.PureComponent<Props, State> {
state: State = toCommonState()
props: Props
render() {
console.log(this.props)
return this.props.children
}
}
const Invalid = props => <Eh url={10} text="required" />
const Required = props => <Eh url={''} />
const Widget = props => <Eh url={'https'} text="required" children={['can be "any']} />