Skip to content

Instantly share code, notes, and snippets.

View lxyad's full-sized avatar

T̶̛̛͓̗̣̹̺͓̠̘̭̤̫̩̰̝͎̹̙̦̍ͨ̃ͪ̉̽̍̚ȏ̴̥̮̟̥̞̱̻̆ͣ̔͌̔̄̆̒̇ͦ͂͌ͤ̏͛͝͝ ̴̬͍̮̫͖̩̣͙͈̖͙͙̝͉̳̙̹̌̏͑̐̄̈̿̆ͬ͘͝͠i̬̞̗͖̞̬͍̣̹̖̰̞̺̔ͬ̓ͮͩͤ͂̋͆ͬͨ̇ͣ͛̍̔ͧͯ̀̚͟͜n͈̤̤͓̲̣̺̽̀̓̅͋ͩ̀́̕ͅv̴̞̣̖͖ͪͬ̍ͨͯ̔͂͘ơ̸͓͍̬̣̙̼̝̭̱͖̰̺̠͙͇̮̣͌͗͋k͐ͤ́̒̈͐̃̎̃̓̈ͫͫ͑ͥ̍̊̚͏̖͔̫͓̳͇͚̥ę̨̭͕̭͈͈̰̤̐̏͗̄ͮ͊͊̆̾͜ lxyad

  • <Less is="more" />
View GitHub Profile
@fdidron
fdidron / App.js
Last active September 26, 2025 04:26
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@gaearon
gaearon / connect.js
Last active October 13, 2025 06:56
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (