has power
Robert Kuliński
Kamil Rykowski
$ node -v
v10.1.0
// macOS
$ brew install node
// Linux
$ sudo apt-get install nodejs$ yarn -v
1.7.0
// macOS
$ brew install yarn
// Linux
$ sudo apt-get install yarnWhat is it?
Open source SDK for building mobile cross platform applications using JavaScript.
The big players
do you event lift?
* libs exists & are well maintained, but I didn't yet battle tested it
const Galaxy = () => {
const characters = [
'Luke Skywalker',
'Kylo Ren',
'Rey',
];
return (
<div>
<h1>Star Wars: The Last Jedi</h1>
<p>
A long time ago in a galaxy far,
far away...
</p>
<ul>
{characters.map((item) => (
<li>{item}</li>
)}
</ul>
</div>
);
}import {
View, Text, FlatList,
} from 'react-native';
const Galaxy = () => {
const characters = [
'Luke Skywalker',
'Kylo Ren',
'Rey',
];
return (
<View>
<Text>Star Wars: The Last Jedi</Text>
<Text>
A long time ago in a galaxy far,
far away...
</Text>
<FlatList
data={characters}
renderItem={({item}) => (
<Text>{item}</Text>
)}
/>
</View>
);
}Components mapping
div == View
button == Button
img == Image
select == Picker
<input type="checkbox" /> == Switch
<input type="text" /> == TextInput
p, h1, h2 == Textalso through UI kits
Just like CSS
const styles = {
wrapper: {
width: 100,
height: 100,
backgroundColor: 'red,
}
};
<View style={styles.wrapper}>
<Text>React</Text>
</View>const styles = StyleSheet.create({
wrapper: {
width: 100,
height: 100,
backgroundColor: 'red,
}
});
<View style={styles.wrapper}>
<Text>Native</Text>
</View>Built-in and external
AsyncStorage
CameraRoll
Geolocation
Keyboard
NetInfo
Share
VibrationFacebook SDK
Firebase SDK
Permissions
Camera
Push Notifications
Phone Call
SMS
npm install -g react-native-cli
react-native init hasPower
cd hasPower
react-native run-android / run-iosDefault way
npm install -g react-native-cli
git clone
https://github.com/rkulinski/react-native-boilerplate-basic.git
cd react-native-boilerplate-basic
npm i
react-native run-android / run-ios
Has Power way
It's alive!
⌘M or Ctrl+MDevelop & debug
⌘DParty Time
Coding Part - Chat App
Task1
Form Screen
Task2
Navigation
Task3
Native API
Task4
Do the rest... ;)
Your goal is to create mobile "Chat app". Everyone can post a message there and everybody sees history.
Task4
AC
Zapisywanie i odczyt danych użytkownika do/z async storage
Dołączanie tych parametrów w request
Wyświetlanie danych z serwera (zdjęcie + wiadomość)
Zrobienie zdjęcia i wysłanie go na serwer z podpisem
Możliwość dodania wiadomości tekstowej do wysyłanego zdjęcia
*Dodanie systemu “like” dla wiadomości
*Wyświetlanie “...” na ekranie gdy user wpisuje tekst wiadomości
*Dodanie animacji typu “shake” gdy pojawia się nowa wiadomość
* zadania bonusowe
Let's work!