Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native prop types validation #40

Open
nick-skriabin opened this issue Jun 25, 2018 · 2 comments
Open

React Native prop types validation #40

nick-skriabin opened this issue Jun 25, 2018 · 2 comments

Comments

@nick-skriabin
Copy link

nick-skriabin commented Jun 25, 2018

React fails to validate View on GatewayDest as a value of component property.

Failed prop type: Invalid prop `component` supplied to `GatewayDest`.

Code:

import React, {Component} from 'react'
import {View} from 'react-native'
import {GatewayProvider, GatewayDest} from 'react-gateway'

class RootComponent extends Component {

  /* ... */

  render () {
    const RootRoute = createRootRoute(this.state.isAuthorized)
    return this.state.isReady ? (
      <GatewayProvider>
        <View style={{flex: 1}}>
          <RootRoute ref={(el) => (this.rootRoute = el)} />
          <Notifier/>
          <GatewayDest name="inputAccessory" component={View}/>
        </View>
      </GatewayProvider>
    ) : null
  }
}
@Titozzz
Copy link

Titozzz commented Jul 12, 2018

Same issue here.

@jordoh
Copy link

jordoh commented Jul 27, 2018

Since it's expecting a string or function, this satisfies the prop type:

<GatewayDest name="inputAccessory" component={ props => <View { ...props } /> }/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants