I hereby claim:
- I am austinroy on github.
- I am austinroy (https://keybase.io/austinroy) on keybase.
- I have a public key ASA5tch3YR4myoY8QjHMD5fHdbltEfrFDsIJ0eq2rLpXxwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import ReactAtellier from 'react-atellier'; | |
import myComponent from 'myComponent'; | |
//import other components here | |
const componentList = [{ | |
componentName : myComponent.displayName, | |
component : myComponent | |
}, | |
//...map other components | |
]; |
import "mapbox-gl/dist/mapbox-gl.css" | |
import "react-map-gl-geocoder/dist/mapbox-gl-geocoder.css" | |
import React, { Component } from 'react' | |
import MapGL from "react-map-gl"; | |
import DeckGL, { GeoJsonLayer } from "deck.gl"; | |
import Geocoder from "react-map-gl-geocoder"; | |
const token = process.env.REACT_APP_TOKEN | |
class SearchableMap extends Component { |
import React,{ useState } from 'react' | |
import MapGL, {GeolocateControl } from 'react-map-gl' | |
import config from '../config' | |
import 'mapbox-gl/dist/mapbox-gl.css' | |
const TOKEN=config.REACT_APP_TOKEN | |
const geolocateStyle = { | |
float: 'left', | |
margin: '50px', |
class ScrollingList extends React.Component { | |
listRef = null; | |
getSnapshotBeforeUpdate(prevProps, prevState) { | |
// Are we adding new items to the list? | |
// Capture the scroll position so we can adjust scroll later. | |
if (prevProps.list.length < this.props.list.length) { | |
return ( | |
this.listRef.scrollHeight - this.listRef.scrollTop | |
); |
state = { cachedSomeProp: null }; | |
static getDerivedStateFromProps(nextProps, prevState) { | |
// do things with nextProps.someProp and prevState.cachedSomeProp | |
return { | |
cachedSomeProp: nextProps.someProp, | |
.. | |
}; | |
} |
const getInfo = () => fetch("https://myApi.apiexample").then(res => res.json()) | |
const ApiResource = createResource(getInfo) | |
const SayHello = () => { | |
const data = ApiResource.read() | |
return <div>Hi {data.name}</div> | |
} |
const DataComponent = React.lazy(() => import('./DataComponent')); | |
function MySuspenseComponent(){ | |
return ( | |
<Suspense fallback={<Spinner />}> | |
<DataComponnent/> | |
<Suspense> | |
) | |
} |
const DataComponent = React.lazy(() => import('./DataComponent')); | |
function MySuspenseComponent(){ | |
return ( | |
<Suspense fallback={<Spinner />}> | |
<DataComponnent/> | |
<Suspense> | |
) | |
} |
// ------------ | |
// First render | |
// ------------ | |
useState('Mary') // 1. Initialize the name state variable with 'Mary' | |
useEffect(persistForm) // 2. Add an effect for persisting the form | |
useState('Poppins') // 3. Initialize the surname state variable with 'Poppins' | |
useEffect(updateTitle) // 4. Add an effect for updating the title | |
// ------------- | |
// Second render | |
// ------------- |