Created
June 29, 2018 06:39
-
-
Save o0101/a35091b96cddd139d1b0a6fb9b92ed11 to your computer and use it in GitHub Desktop.
Better React - AKA REACT FUCK YOU - AKA RACT
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
/** | |
In react we do | |
function Component(props) { | |
return <h1> Hello, {props.name}</h1>; | |
} | |
**/ | |
// in RACT, racked we do | |
function Component(props) { | |
return `<h1> Hello, ${props.name}</h1>`; | |
} | |
// Code expansion: #props_used + 2 ( 1 extra character for each prop + 2 for the start and end backticks ) | |
// But build simplification: | |
// - No JSX | |
// - No transpilation | |
// - No complex build chain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment