Skip to content

Reorganization of course repository #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ npm-debug.*
*.orig.*
web-build/
.vscode
package-lock.json
*.env*

# macOS
.DS_Store
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 2,
"trailingComma": "none"
}
28 changes: 10 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,28 @@ This repository contains code snapshots and other attachments (e.g., slides) for

You may use the provided resources to follow along with the course, debug your code or to compare your solution to Maximilian's. Re-distributing course materials (including the content provided with this repository) is not permitted.

# How To Use
# How To Navigate This Repository

This repository contains multiple [branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches). Every branch represents a course section and contains the resources that belong to that section.
1. The `/code` folder is separated into the different course sections

For example, the branch [02-basics](https://github.com/academind/react-native-practical-guide-code/tree/02-basics) contains all course resources (e.g., code snapshots) that belong to section 2 ("React Native Basics") of the course.
- each section contains multiple snapshots throughout the section

You can switch branches via the dropdown in the top left corner of this repository page:
2. The `/attachments` folder is also separated into different course sections and contains any relevant attachments from the section, as well as starting snapshots (if applicable)

![Selecting a branch](./selecting-branches.png)

# Provided Resources

In most branches (i.e., for most course sections), you find the following folders in the repository branch:

- **`/code`**: Contains multiple subfolders with different code snapshots for this course section (also see [Using Code Snapshots](#using-code-snapshots))
- **`/slides`**: Contains section slides (if slides were shown / used in the section)
- **`/extra-files`**: Contains any extra files that were used (e.g., image assets that were used in the section)
3. The `/slides` folder contains any relavant pdf documents of all the slides in this course, split across sections

# Using Code Snapshots

Code snapshots (which you find in `/code`) are there for you to compare your code to mine and find + fix errors you might have in your code.
Code snapshots (which you find in `/code/<section-name>/`) are there for you to compare your code to mine and find + fix errors you might have in your code.

You can either view my code directly here on Github (you can open + view code files without issues here) or you download the snapshots. To download (or [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) the snapshots, simply use the **"Code" button** in the top right corner of the repository. This allows you to download the currently selected branch. You can then browse the code snapshots locally on your machine.

The subfolders in the `/code` folder are named such that mapping them to the course lectures is straightforward.
The subfolders in the `/code` folder are named such that mapping them to the course sections is straightforward (inside of which you will find intermittent snapshots throughout each section).

# Running The Provided Code

The provided code is primarily meant to be used for code comparisons (i.e., so that you can compare your code to mine to find + fix errors).
The provided code is primarily meant to be used for code comparisons (i.e., so that you can compare your code to mine to find + fix errors).

But you can also run my project code by navigating into the respective code snapshots subfolder (i.e., a subfolder in the `/code` folder) and executing `npm install` followed by `npm start` there.
But you can also run my project code by navigating into the respective code section snapshots folder (i.e., a subfolder in the `/code` folder) and executing `npm install` followed by `npm start` there.

Please note that dependency mismatches could lead to errors here, even if the provided code itself still works and is correct. In addition, you will always need to bring your own backend URLs (e.g., Firebase) or API keys, if any were used in the course section!
Please note that dependency mismatches could lead to errors here, even if the provided code itself still works and is correct. In addition, you will always need to bring your own backend URLs (e.g., Firebase) or API keys, if any were used in the course section!
20 changes: 20 additions & 0 deletions attachments/01-getting-started/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Binary file added attachments/02-basics/00-starting-project.zip
Binary file not shown.
Binary file added attachments/02-basics/goal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attachments/03-debugging/00-starting-project.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions attachments/04-deep-dive-real-app/logic/random.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function generateRandomBetween(min, max, exclude) {
const rndNum = Math.floor(Math.random() * (max - min)) + min;

if (rndNum === exclude) {
return generateRandomBetween(min, max, exclude);
} else {
return rndNum;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading