(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// getComponent is a function that returns a promise for a component | |
// It will not be called until the first mount | |
function asyncComponent(getComponent) { | |
return class AsyncComponent extends React.Component { | |
static Component = null; | |
state = { Component: AsyncComponent.Component }; | |
componentWillMount() { | |
if (!this.state.Component) { | |
getComponent().then(Component => { |
I did some poking around CodeMirror and how it works, particularly with it's current code folding implementation. My goal was to see if there was a way to only have part of the string in memory, render those parts, and still have line numbers be correct. My goal was to have the editor display something like this:
1
2
3 function() {
27 }
28
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
function MyResponsiveComponent() { | |
const width = useWindowWidth(); // Our custom Hook | |
return ( | |
<p>Window width is {width}</p> | |
); | |
} |
import { useEffect, useReducer, useRef } from 'react'; | |
import { useNavigation } from '@react-navigation/native'; | |
import { useSelector } from 'react-redux'; | |
const undefinedRef = Symbol(); | |
const refEquality = (a: Object, b: Object) => a === b; | |
export function useAppSelector<Selected = unknown>( |