# Project Tree & Script Structure

![](https://3241674717-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_DfhjIgb2njPA7L1mD%2F-L_Md8IInR72abJDZo30%2F-L_Mek-U55NltxhkALsq%2Fimage.png?alt=media\&token=496da73c-6927-4997-a389-f3f4cbe89e3a)

The above is the default structure. We should also create following items

```
/
|- src
|- components         # Storing the customized components
|- index.ios.js
|- index.android.js
```

Always Create one component for a file

```jsx
// Index.ios.js - place code in here for iOS!!!

//  Import a library to help create a component
import React from 'react';
// import ReactNative from 'react-native';
// Access Object inside the library React Native: components in ReactNative
import { Text, AppRegistry } from 'react-native';

// Create a component by using the liibraries
// A component is a javascript function that return JSX Object

// {} is a JS Function, () is a JSX Object
const App = () => (
    <Text>Some Text</Text> // Text is primitive component
);

// Render the components to the device
// Please take this component and show it on the screen
// At least register one component to the app, when app is start, it will render the assigned component

// ReactNative.AppRegistry.registerComponent('albums', () => App);
AppRegistry.registerComponent('albums', () => App);
```

![](https://3241674717-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_DfhjIgb2njPA7L1mD%2F-L_QS-yn_dKxzLLjdPz2%2F-L_QSHeaX5_kQlfJiLFK%2Fimage.png?alt=media\&token=8498d762-9c30-4635-b2ce-540e649f146d)

```jsx
// import libraries for making a component
import React from 'react';
import { Text } from 'react-native';
import Header from "./src/components/header" # Custom Component

// Make a component
const Header = () => {
    return <Text>Albums!</Text>;
};

// Make the component available to another parts of the app
export default Header;
```

### Reference:

* [Babel · The compiler for writing next generation JavaScript](http://babeljs.io)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://react-native.books.c-k.dev/introduction/project-tree-and-script-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
