Kabeer
Kabeer

Reputation: 45

export default class App extends React.Component

i am a begginer of expo and i encountered this in the app.js file

export default class App extends React.Component

Can anyone explain what this line of code actually mean? i cant understand this

Upvotes: 1

Views: 2960

Answers (1)

Matt
Matt

Reputation: 324

You should tag this with react-native instead of react, react-native is used with Expo for creating mobile apps, the 'native' part refers to how it uses native components from either IOS or Android which are written in Swift and Java respectively.

However, I can tell you that what that line of code is doing is exporting the class App so that other files can import it. App extends React.Component which gives the class access to methods and lifecycle hooks. It's basic ES6 Javascript, if you're going to be writing React then you're going to want to start with the basics of Javascript including ES6.

Upvotes: 1

Related Questions