Skip to content

Commit

Permalink
Merge pull request #2 from SpaceUY/fix/readme_and_links
Browse files Browse the repository at this point in the history
[FIX] - readme links and nav title
  • Loading branch information
ilatour authored Jul 30, 2024
2 parents 645f471 + ab42099 commit 00b7aa0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
### Glossary

1. **[Home](./index.md)**
2. **[Environment Setup](docs/network.md)**
3. **[Navigation](docs/navigation.md.md)**
4. **[State Management](docs/state.md.md)**
2. **[Environment Setup](docs/setup.md)**
3. **[Navigation](docs/navigation.md)**
4. **[State Management](docs/state.md)**
5. **[Network Management](docs/network.md)**

<br />
Expand Down
20 changes: 10 additions & 10 deletions docs/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: default
nav_order: 3
---

# Expo Router
# Navigation ( with Expo Router)

Expo router is a multi-platform routing framework for react native and web applications. Is important to mention that It uses a **FILE-BASED** method to determine routes inside your app.

Expand All @@ -13,20 +13,20 @@ The basic structure would be as follows:
<img src="../assets/img/structure.png" alt="Mobile Development" width="300">
<br>

### Installation
## Installation

Expo router is included when creating a default expo project using the following command:

`npx create-expo-app AppName`

### How do \_layout files work?
## How do \_layout files work?

In the root `_layout`, it is recommended to insert the necessary providers, such as authentication, state management tools, context, themes, etc. In Expo Router, each subfolder created generates what are called 'Route Groups', which can contain their own layout. The layout acts as a sort of middleware for the routes (files) within that folder, allowing us to configure the stacks, tabs, and routes we want to have within each layout. Additionally, any extra logic needed for that subgroup of routes can be added.

It is important to remember that routes must have a unique name globally. Their names must match the existing file for that route, and stack options can be customized by declaring the stack in the respective layout file. It is also important to note that if a folder does not contain a layout, Expo Router automatically generates the stack based on the existing files and their names.
As a reminder, you can use `useRootNavigationState` from expo-router to debug the navigation state.

### Authentication
## Authentication

For authentication, remember that with Expo Router, all routes are always defined and accessible. You should use runtime logic to redirect users away from specific screens depending on whether they are authenticated.

Expand All @@ -51,17 +51,17 @@ It would look something like this:

Expo Router redirects to the index file of the folder or subfolder it finds. If an index file is not found, it generally may not locate a valid initial route. If there are multiple folders containing an index file, Expo Router will follow the alphabetical order of these folders rather than the order in which routes are defined in the stack.

### Tips
## Tips

Screen con bottom tab sin tab button:
To have a route available within a tab stack without displaying the tab button, you can create the file for that route, then define the tab screen in the layout, and in the options for that tab screen, set href:null. The route will exist in the tab stack and will continue to display the bottom tab bar when represented, but without having its own button.

### Sources
## Sources

https://docs.expo.dev/router/
https://docs.expo.dev/router/advanced/root-layout/
https://docs.expo.dev/router/advanced/tabs/
https://docs.expo.dev/router/advanced/stack/
<a>https://docs.expo.dev/router/</a>
<a>https://docs.expo.dev/router/advanced/root-layout/</a>
<a>https://docs.expo.dev/router/advanced/tabs/</a>
<a>https://docs.expo.dev/router/advanced/stack/</a>

<br />
<br />
Expand Down

0 comments on commit 00b7aa0

Please sign in to comment.