import * as React from 'react' ; import { View , Text , TouchableOpacity } from 'react-native' ; import { stylable } from 'react-native-stylable' ; export interface IButtonProps extends IElementProps { style ? : any ; attr : { page ? : string ; params ? : { [ key ] : string ; } ; pageparams ? : { [ key ] : string ; } ; } ; submit ( params ) : void ; } class LinkPage extends React . PureComponent < IButtonProps > { public render ( ) { const { children , style } = this . props ; return ( < TouchableOpacity activeOpacity = { 0.8 } style = { [ style ] } onPress = { this . handleSubmit } > { children } < /TouchableOpacity>); } private handleSubmit = ( ) => { const { attr : { page , params , pageparams } , submit } = this . props ; submit ( { page , pageparams : pageparams || params } ) ; } ; } export default stylable ( 'LinkPage' ) ( LinkPage ) ;