This file contains hidden or 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
const style = Stylesheet.create({ | |
visible: { | |
display: block, | |
color: 'red', | |
}, | |
invisible: { | |
display: none, | |
}, | |
}) |
This file contains hidden or 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
// K čemu to je? | |
// Varianta 1. importování | |
import classes from './styles' | |
export default ({ visible }) => { | |
return ( | |
<div className={visible ? classes.visible : classes.invisible}>This is some text</div> | |
) |
This file contains hidden or 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
// K čemu to je? | |
// Varianta 1. importování | |
import classes from './styles' | |
export default ({ visible }) => { | |
return ( | |
<div className={visible ? classes.visible : classes.invisible}>This is some text</div> | |
) |
This file contains hidden or 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
// template.php | |
<ul class="posts"> | |
<?php foreach ($properties['posts'] as $post): ?> | |
<li> | |
<?= $post->title ?> | |
</li> | |
<?php endif; ?> | |
</ul> | |
// does this seem to you as crazy?! |
This file contains hidden or 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
//pohoda, žádnej callback | |
const fn = (props) => { | |
return div({ | |
}, props.text) | |
} | |
// budu chtít zařídit to, aby se po kliknutí něco stalo | |
props.onClick = (event) => { //pičoviny } |
This file contains hidden or 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
function asyncIter(arr, fn, errCb) { | |
var i = 0 | |
function runIt() { | |
try { | |
fn(arr[i], i, function() { | |
i++ | |
if (i < arr.length) { | |
setTimeout(runIt, 5) | |
} |
This file contains hidden or 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
// tohle je prostě entry point pro kód buďto webovej nebo nativní - můžeš udělat kolik endpointů chceš pro jako platformu | |
import * as actions from './actions' | |
import { createStore } from 'redux' | |
// v native-entry.js si requirneš jinej router prostě, zbytek bude prakticky stejnej | |
import Router from 'router' | |
import routes from 'routes' | |
import { Provider } from 'redux-react' | |
Router.config({ routes }) |
This file contains hidden or 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
const createApiComponent = (requestFn, initialState = {}) => (component) => { | |
return class extends React.Component { | |
state = { loading: false, ...initialState } | |
componentDidMount() { | |
this.setState({ loading: true }) | |
requestFn() | |
.then(apiResult => { this.setState({ apiResult, loading: false }) }) | |
.catch(apiError => { this.setState({ apiError, loading: false }) }) | |
} |
This file contains hidden or 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
FB událost: | |
POZOR: Registrace na workshop probíhá přes EventBrite! Zde: <!! odkaz> | |
Třídílná série přednášek od lektorů - Petr Brzek, Jiří Vyhnálek a Vojta Tranta. | |
Každý lektor má na starosti jednu tématickou část - základy a filozofie - Vojta Tranta (@Avocode), React prakticky Petr Brzek (founder @Avocode), asynchronní kód a state management Jiří Vyhnálek (@Microsoft CZ). | |
Tato část kurzu už bude konečně o Reactu - Konečně React! |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>PHP a JS</title> | |
</head> | |
<body> | |
<h1>Aplikačka</h1> | |
<div id="app"></div> | |
</body> |