I hereby claim:
- I am frankgerold on github.
- I am callipygous (https://keybase.io/callipygous) on keybase.
- I have a public key ASC7wpKPGAPljBRGvaIskHZTlpOYRGIA4veHsWO_THkUqQo
To claim this, I am signing this object:
testing testing 420 blaze it | |
import React, { Component } from 'react'; | |
class Demo extends Component { | |
render() { | |
return ( | |
<div>Class Component</div> | |
); | |
} | |
} | |
export default Demo; |
import React from 'react'; | |
const Demo = (props) => ( | |
<div>Functional Component</div> | |
); | |
export default Demo; |
componentDidMount() { | |
this.timerID = setInterval(() => this.tick(), 1000 ); | |
} | |
componentDidUpdate(prevProps, prevState) { | |
// Typical usage (don't forget to compare props): | |
if (this.props.userID !== prevProps.userID) { | |
this.fetchData(this.props.userID); | |
} | |
} | |
componentWillUnmount() { |
import React, { Component } from 'react'; | |
class BookSearch extends Component { | |
//Empty list initializing state | |
state = { | |
bookList: [] | |
} | |
// Perform external fetch after mounting component | |
componentDidMount() { |
import React, { useState, useEffect } from 'react'; | |
const BookSearch = (props) => { | |
// Set Book List state variable with State Hook | |
const [bookList, setBookList] = useState([]) | |
useEffect(() => { | |
fetch('https://www.googleapis.com/books/v1/volumes?q=react+JS+hooks') | |
.then(response => response.json()) |
BEGIN MESSAGE. | |
DjSN69NJx6s1FwV O2q4VjFEyhpN26j 2S6E3zA8cDJJlTk WxrjPrUJJEs7yXl | |
TGHlkBpTSpbbqWj OnyHmipNXnmTCKq 6Xr2MZHgg6UzVWF 3VBea0HBKB7cnkF | |
EiNoKhyjeN6ODY3 l1hqAyNiYRUCedl EBdPvITECLccnTN qRtaIJeNoTtPiIT | |
SEvyGKBCWwZkCPR z52qSlnNvHP4Ve3 avuzh0aLMzWSiL. | |
END MESSAGE. |
I hereby claim:
To claim this, I am signing this object:
const AppComponent = ({ Component, pageProps }) => { | |
return <div> | |
<Component {...pageProps} /> | |
</div> | |
}; | |
AppComponent.getInitialProps = async appContext => { | |
let pageProps = {}; | |
if (appContext.Component.getInitialProps) { | |
pageProps = await appContext.Component.getInitialProps(appContext.ctx); |
import React, { useState, useEffect } from 'react'; | |
import { Accelerometer } from 'expo-sensors'; | |
export default function App() { | |
const [data, setData] = useState({}); | |
useEffect(() => { | |
_subscribe(); | |
}, []); |