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
const App = React.createClass({ | |
render() { | |
return ( | |
<Repeat collection={[1, 2]}> | |
{item => <div>{item}</div>} | |
</Repeat> | |
); | |
} | |
}); |
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 ReactDOM from 'react-dom'; | |
import {Gmaps, Marker, InfoWindow} from 'react-gmaps'; | |
const points = [{ | |
lat: 51.5258541, | |
lng: -0.09040660000006028 | |
}, { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 |
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 styled from 'styled-components' | |
import renderer from 'react-test-renderer' | |
import { shallow, mount } from 'enzyme' | |
import { render } from 'react-testing-library' | |
const Button = styled.button` | |
color: red; | |
` |
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 { Action, withStatechart } from 'react-automata' | |
const statechart = { | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
FETCH: 'fetching', | |
}, |
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
class DecrementAction extends Error {} | |
class IncrementAction extends Error {} | |
const reducer = (state, error) => { | |
switch (error.constructor) { | |
case DecrementAction: | |
return state - 1 | |
case IncrementAction: | |
return state + 1 |
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
expect.extend({ | |
toBeShallowInstanceOf(received, argument) { | |
const pass = Object.getPrototypeOf(received) === argument.prototype | |
return { | |
message: () => (pass ? 'OK' : 'KO'), | |
pass, | |
} | |
}, | |
}) |
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
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028, | |
}; | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Gmaps, Marker } from 'react-gmaps'; | |
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 | |
}; | |
const beach = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'; |
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 ReactDOM from 'react-dom'; | |
import {Gmaps, Marker, InfoWindow} from 'react-gmaps'; | |
const points = [{ | |
lat: 51.5258541, | |
lng: -0.09040660000006028 | |
}, { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 |
NewerOlder