Skip to content

Instantly share code, notes, and snippets.

function Counter () {
const [numClicks, setNumClicks] = useState(0);
return (
<div>
<p>You have clicked {numClicks} times!</>
<button onClick={() => setNumClicks(numClicks+1)>
Click Me
</button>
</div>
)
function App() {
const userName = "Some Name";
return (
<div>
<WelcomeMessage userName={userName}/>
<ReactButton/>
</div>
)
}
function WelcomeMessage(props) {
return (
<div>
<p>Welcome {props.userName}!</p>
<p>It's nice to see you here!</p>
</div>
)
}
function App() {
const userName = 'Some Name';
return (
<div>
<p>Hello {userName}!</p>
<ReactButton/>
</div>
)
}
function ReactButton() {
const link = 'https://reactjs.org';
return (
<div>
<a href={link} target="_blank" rel="noopener noreferrer">
Go To React
</a>
</div>
)
}
function App() {
const userName = 'Some Name';
return (
<div>
<p>Hello {userName}!</p>
</div>
)
}
function App() {
return (
<div>
<p>Hello World!</p>
</div>
)
}
@alexkuttig
alexkuttig / sending_notification_local.js
Created September 19, 2019 07:04
Scheduling local notifications
// create channel first on android
// create notification
let notification = new firebase.notifications.Notification()
.setTitle("My reminder")
.setBody("My reminder text")
.setData({
type: "reminder",
})
.android.setChannelId(channel.channelId);
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationNativeContainer>
<Tab.Navigator>
<Tab.Screen name="Home" screen={HomeScreen} />
<Tab.Screen name="Settings" screen={SettingsScreen} />
</Tab.Navigator>
</NavigationNativeContainer>
// @flow
'use strict';
import React, {Component} from 'react';
import {
StyleSheet,
Text,
View,
Platform,
FlatList,
Animated,