VP of Engineering @ BAM
@yleflour
joyto.dev
Ted Nelson
P. G. Neumann
R.C Daley
Tim Berners-Lee
D. Kristol, L. Montulli (html/rfc2109)
R. Fielding (html/rfc1080)
Glenn E. Krasner, Stephen T. Pope
D. Kristol, L. Montulli (html/rfc2109)
R. Fielding (html/rfc1080)
Glenn E. Krasner, Stephen T. Pope
Marcio Galli, Roger Soares, Ian Oeschger (2003)
(2010)
Marcio Galli, Roger Soares, Ian Oeschger (2003)
(2010)
angular.
module('phonecatApp').
config(['$routeProvider',
function config($routeProvider) {
$routeProvider.
when('/phones', {
template: '<phone-list></phone-list>'
}).
when('/phones/:phoneId', {
template: '<phone-detail></phone-detail>'
}).
otherwise('/phones');
}
]);
<a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a>
this.router.navigate(["../../parent"], {relativeTo: this.route,
queryParams: {p1: 'value', p2: 'v2'}, fragment: 'frag'});
<Switch>
<Route path="/about">
<About />
</Route>
<Route path="/users">
<Users />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
<Link to="/users">Users</Link>
<Route exact path="/">
{loggedIn ? <Redirect to="/dashboard" /> : <PublicHomePage />}
</Route>
angular.
module('phonecatApp').
config(['$routeProvider',
function config($routeProvider) {
$routeProvider.
when('/phones', {
template: '<phone-list></phone-list>'
}).
when('/phones/:phoneId', {
template: '<phone-detail></phone-detail>'
}).
otherwise('/phones');
}
]);
<a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a>
this.router.navigate(["../../parent"], {relativeTo: this.route,
queryParams: {p1: 'value', p2: 'v2'}, fragment: 'frag'});
<Switch>
<Route path="/about">
<About />
</Route>
<Route path="/users">
<Users />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
<Link to="/users">Users</Link>
<Route exact path="/">
{loggedIn ? <Redirect to="/dashboard" /> : <PublicHomePage />}
</Route>
<Switch>
<Route path="/about">
<About />
</Route>
<Route path="/users">
<Users />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
<Link to="/users">Users</Link>
<Route exact path="/">
{loggedIn ? <Redirect to="/dashboard" /> : <PublicHomePage />}
</Route>
Navigation.setRoot({
root: {
bottomTabs: { children: [{
stack: { children: [{
component: {
name: 'Home'
}
}]}
},
{
stack: { children: [{
component: {
name: 'Settings'
}
}]}
}]}
}});
Navigation.push(props.componentId, {
component: {
name: 'UserProfile',
passProps: { name: 'John Doe' }
}
});
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Home}
/>
<Stack.Screen
name="Settings"
component={Settings}
/>
</Stack.Navigator>
</NavigationContainer>
navigation.navigate(
'UserProfile',
{ name: 'John Doe' }
);
Navigation.setRoot({
root: {
bottomTabs: { children: [{
stack: { children: [{
component: {
name: 'Home'
}
}]}
},
{
stack: { children: [{
component: {
name: 'Settings'
}
}]}
}]}
}});
Navigation.push(props.componentId, {
component: {
name: 'UserProfile',
passProps: { name: 'John Doe' }
}
});
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Home}
/>
<Stack.Screen
name="Settings"
component={Settings}
/>
</Stack.Navigator>
</NavigationContainer>
navigation.navigate(
'UserProfile',
{ name: 'John Doe' }
);
Navigation.setRoot({
root: {
bottomTabs: { children: [{
stack: { children: [{
component: {
name: 'Home'
}
}]}
},
{
stack: { children: [{
component: {
name: 'Settings'
}
}]}
}]}
}});
Navigation.push(props.componentId, {
component: {
name: 'UserProfile',
passProps: { name: 'John Doe' }
}
});
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Home}
/>
<Stack.Screen
name="Settings"
component={Settings}
/>
</Stack.Navigator>
</NavigationContainer>
navigation.navigate(
'UserProfile',
{ name: 'John Doe' }
);
props.navigation.push('Profile');
profilePage.show();
props.navigation.push('Profile');
profilePage.show();
props.navigation.push('Profile');
profilePage.show();
<Modal
animationType="slide"
transparent={true}
visible={modalVisible}
onRequestClose={() => {
Alert.alert(
"Modal has been closed."
);
}}
>
"Navigation should be your concern #2 after the concept of your product because a bad navigation :
"Navigation should be your concern #2 after the concept of your product because a bad navigation :
yarn add react-nonav
" React Native declarative and reactive navigation "
import React from 'react';
import { Canal, Screen } from 'react-nonav';
import { FirstName } from './FirstName';
import { LastName } from './LastName';
const SignInCanal = () => (
<Canal>
<Screen name="firstname" Component={FirstName} visible />
<Screen name="lastname" Component={LastName} visible={false} />
</Canal>
);
yarn add react-nonav
" React Native declarative and reactive navigation "
import React from 'react';
import { Canal, Screen } from 'react-nonav';
import { FirstName } from './FirstName';
import { LastName } from './LastName';
const SignInCanal = () => (
<Canal>
<Screen name="firstname" Component={FirstName} visible />
<Screen name="lastname" Component={LastName} visible={false} />
</Canal>
);
import React from 'react';
import { Canal, Screen } from 'react-nonav';
import { FirstName } from './FirstName';
import { LastName } from './LastName';
const SignInCanal = () => (
<Canal>
<Screen name="firstname" Component={FirstName} visible />
<Screen name="lastname" Component={LastName} visible={false} />
</Canal>
);
import React from 'react';
import { Canal, Screen } from 'react-nonav';
import { FirstName } from './FirstName';
import { LastName } from './LastName';
const SignInCanal = () => (
<Canal>
<Screen name="firstname" Component={FirstName} visible />
<Screen name="lastname" Component={LastName} visible={false} />
</Canal>
);
import React from 'react';
import { Canal, Screen } from 'react-nonav';
import { FirstName } from './FirstName';
import { LastName } from './LastName';
const SignInCanal = () => (
<Canal>
<Screen name="firstname" Component={FirstName} visible />
<Screen name="lastname" Component={LastName} visible={false} />
</Canal>
);
Fully featured state machine
Adheres to W3C State Charts Specs
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});
const fetchMachine = Machine({
id: 'root',
initial: 'home',
context: {
token: null
},
states: {
home: {
on: {
ACCOUNT_PRESS: [
{target: 'logIn', cond: 'isTokenUnavailable' },
{target: 'account', cond: 'isTokenAvailable'}
]
}
},
logIn: {
invoke: {
src: 'backPressHandler',
id: 'back-press-handler'
},
on: {
BACK_PRESS: 'home',
LOGIN: {
target: 'account',
actions: ['persistToken'],
},
}
},
account: {
},
}
});