Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

385
Views
React native View' cannot be used as a JSX component. Its instance type 'View' is not a valid JSX element

I´am currently getting the following error on the View component inside App.tsx: 'View' cannot be used as a JSX component. Its instance type 'View' is not a valid JSX element

I think the issue is related to the library

import React from 'react';

import {View,Text,StyleSheet, Button} from 'react-native'

import {createSwitchNavigator} from 'react-navigation'

const styles = StyleSheet.create({
  txt:{
    fontSize: 48
  },
  view: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center'
  }
})

class screenComponent1 extends React.Component {
  render() {
    return(
      
      <View>
        <Button onPress={() => this.props.navigation.navigate('screenroute2')} title='next page'/>
      </View>
    )
  }
}
class screenComponent2 extends React.Component {
  render() {
    return(
      <View>
        <Button onPress={() => this.props.navigation.navigate('screenroute1')} title='next page'/>
      </View>
    )
  }
}

const AppNavigator = createSwitchNavigator({
  screenroute1: screenComponent1,
  screenroute2: screenComponent2,
})


export default class App extends React.Component {
  render() {
    return <AppNavigator/>
  }
}
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!