This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import { StyleSheet } from "react-native" | |
import { View, Image, Text } from "react-native" | |
import { strings } from "./../Locales/i18n" | |
export default class Two extends React.Component { | |
static navigationOptions = ({ navigation }) => { | |
const { params = {} } = navigation.state | |
return { | |
header: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import { StyleSheet } from "react-native" | |
import { View, Image, Text } from "react-native" | |
import { strings } from "../Locales/i18n" | |
export default class extends React.Component { | |
static navigationOptions = ({ navigation }) => { | |
const { params = {} } = navigation.state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Carousel } from 'react-bootstrap'; | |
const myCarousel = ( | |
<Carousel> | |
<Carousel.Item> | |
<img width={900} height={500} alt="900x500" src="/carousel.png" /> | |
<Carousel.Caption> | |
<h3>First slide label</h3> | |
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p> | |
</Carousel.Caption> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
// Action creator | |
const toggleTodo = isChecked => ({ | |
type: 'TOGGLE_TODO', | |
isChecked, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Here we are importing re-frame.core (our SPA library and referring to it as rf for brevity) | |
(ns simple.core | |
(:require [re-frame.core :as rf] | |
[clojure.string :as str])) | |
;; Event Handler | |
(rf/reg-event-db ;; By calling the reg-event-db function we can register an event handler | |
:change-checkbox ;; for when the :change-checkbox event is dispatched | |
(fn [db [_ new-value]] ;; we then supply a function that takes the db and an event vector as 2 the 2 parameters | |
(assoc db :is-checked new-value))) ;; we update the DB map (think similar to a JS object) :is-checked value to the new value and return |