React Native Beginner: “[Component] is not defined” error

Olivia Chang
react.coach
Published in
1 min readSep 1, 2017
The error

This piece is the first of a series for React Native beginners: commonly encountered errors and how to fix them.

If you’ve encountered this error, it means that you haven’t imported a component and tried to use it in a render function. Make sure to import your component!

For example, if I get the error at the left, “Button is not defined”, it means that I tried to use a <Button /> component but never imported it. So I would need to add the code

import {Button} from 'react-native'

to the top of whichever file I tried to use it in.

--

--