Skip to content

Instantly share code, notes, and snippets.

@o0101
Created June 29, 2018 06:39
Show Gist options
  • Save o0101/a35091b96cddd139d1b0a6fb9b92ed11 to your computer and use it in GitHub Desktop.
Save o0101/a35091b96cddd139d1b0a6fb9b92ed11 to your computer and use it in GitHub Desktop.
Better React - AKA REACT FUCK YOU - AKA RACT
/**
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