0

My import statement:

import Stuff from './components/Stuff';

My directory is laid out with explr as the parent directory, the components directory is a direct subdirectory of the parent dir, and App.js, where the import statement is, is in the parent dir.

My 'Stuff.jsx':

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

export default class Stuff extends React.Component {
  render () {
    return (
      <View style={styles.sidebar} />
    )
  }
}

const styles = StyleSheet.create({
  sidebar: {
    position: 'absolute',
    left: 0,
    top: 20,
    height: '100%',
    width: 200,
    backgroundColor: 'lightslategrey',
    display: 'flex',
    flexDirection: 'column'
  },
})

1 Answer 1

1

React Native does not support importing .jsx files. See my answer here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.