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
| // WeatherPage.js | |
| class WeatherPage extends React.Component { | |
| constructor() { | |
| this.state = { | |
| loading: true, | |
| temperature: null, | |
| error: null, | |
| } | |
| } |
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
| // WeatherPage.js | |
| import LoadingContainer from './LoadingContainer'; | |
| class WeatherPage extends React.Component { | |
| // constructor, componentWillMount, etc... | |
| render() { | |
| return ( |
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
| // LoadingContainer.js | |
| class LoadingContainer extends React.Component { | |
| render() { | |
| if (this.props.loading) { | |
| return ( | |
| <div> | |
| Loading... | |
| </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
| import React from 'react' | |
| import styled from 'styled-components'; | |
| class Blah extends React.Component { | |
| render() { return <div />; } | |
| } | |
| styled(Blah); |
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
| /* @flow */ | |
| function groupByAdjacent<T>(arr: Array<T>, eq: (T, T) => boolean): Array<Array<T>> { | |
| return arr.reduce((prev, curr) => { | |
| if (prev.length && eq(curr, prev[prev.length - 1][0])) { | |
| prev[prev.length - 1].push(curr); | |
| } else { | |
| prev.push([curr]); | |
| } | |
| return prev; | |
| }, []); |
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
| '.source.js': | |
| '[DD] query renderer': | |
| prefix: 'queryrendererfile' | |
| body: """ | |
| /* @flow */ | |
| import React from 'react'; | |
| import { graphql } from 'react-relay/compat'; | |
| import DefaultQueryRenderer from 'components/DefaultQueryRenderer'; | |
| import type { $1QueryResponse } from './__generated__/$1Query.graphql'; |
OlderNewer