Skip to content

Instantly share code, notes, and snippets.

View RoRoGadget's full-sized avatar

Rohan Panchal RoRoGadget

View GitHub Profile
@RoRoGadget
RoRoGadget / SectionList.jsx
Created June 5, 2019 16:45
SwiftUI4RN-SectionList
import React, { Component } from 'react';
import { AppRegistry, SectionList, StyleSheet, Text, View } from 'react-native';
export default class SectionListBasics extends Component {
render() {
return (
<View style={styles.container}>
<SectionList
sections={[
{title: 'D', data: ['Devin']},
@RoRoGadget
RoRoGadget / ListView.jsx
Created June 5, 2019 16:38
SwiftUI4RN-ListView
import React, { Component } from 'react';
import { AppRegistry, FlatList, StyleSheet, Text, View } from 'react-native';
export default class FlatListBasics extends Component {
render() {
return (
<View style={styles.container}>
<FlatList
data={[
{key: 'Devin'},
@RoRoGadget
RoRoGadget / ScrollView.jsx
Created June 5, 2019 16:31
SwiftUI4RN-ScrollView
import React, { Component } from 'react';
import { AppRegistry, ScrollView, Image, Text } from 'react-native';
export default class IScrolledDownAndWhatHappenedNextShockedMe extends Component {
render() {
return (
<ScrollView>
<Text style={{fontSize:96}}>Scroll me plz</Text>
<Image source={{uri: "https://facebook.github.io/react-native/img/favicon.png", width: 64, height: 64}} />
<Image source={{uri: "https://facebook.github.io/react-native/img/favicon.png", width: 64, height: 64}} />
@RoRoGadget
RoRoGadget / TouchInput.jsx
Last active June 8, 2019 12:41
SwiftUI4RN-TouchInput
import React, { Component } from 'react';
import { Alert, AppRegistry, Button, StyleSheet, View } from 'react-native';
export default class ButtonBasics extends Component {
_onPressButton() {
Alert.alert('You tapped the button!')
}
render() {
return (
@RoRoGadget
RoRoGadget / TextInput.jsx
Last active June 5, 2019 16:11
SwiftUI4RN-TextInput
import React, { Component } from 'react';
import { AppRegistry, Text, TextInput, View } from 'react-native';
export default class PizzaTranslator extends Component {
constructor(props) {
super(props);
this.state = {text: ''};
}
render() {
@RoRoGadget
RoRoGadget / Size.jsx
Last active June 5, 2019 16:01
SwiftUI4RN-Size
import React, { Component } from 'react';
import { AppRegistry, View } from 'react-native';
export default class FixedDimensionsBasics extends Component {
render() {
return (
<View>
<View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<View style={{width: 100, height: 100, backgroundColor: 'skyblue'}} />
<View style={{width: 150, height: 150, backgroundColor: 'steelblue'}} />
@RoRoGadget
RoRoGadget / Style.jsx
Created June 5, 2019 15:46
SwiftUI4RN
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
const styles = StyleSheet.create({
bigBlue: {
color: 'blue',
fontWeight: 'bold',
fontSize: 30,
},
red: {
@RoRoGadget
RoRoGadget / State.jsx
Last active June 5, 2019 15:31
SwiftUI4RN-State
import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
class Blink extends Component {
componentDidMount(){
// Toggle the state every second
setInterval(() => (
this.setState(previousState => (
{ isShowingText: !previousState.isShowingText }
@RoRoGadget
RoRoGadget / HelloWorld.jsx
Last active June 5, 2019 15:11
SwiftUI4RN-HelloWorld
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class HelloWorldApp extends Component {
render() {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>Hello, world!</Text>
</View>
);