Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Last active September 9, 2015 17:10
Show Gist options
  • Save ryanflorence/5e6a1e3d02ba993c1415 to your computer and use it in GitHub Desktop.
Save ryanflorence/5e6a1e3d02ba993c1415 to your computer and use it in GitHub Desktop.
let Thing = (props) => (
<div>look {props.name}! no state!</div>
)
render(<Thing name="Ma"/>, el)
@stoeffel
Copy link

stoeffel commented Sep 2, 2015

Maybe you guys like https://github.com/stoeffel/react-mini. It has a similar approach.

@Yomguithereal
Copy link

@bebraw it would indeed be cleaner.

@stoeffel
Copy link

stoeffel commented Sep 7, 2015

Just to let you know. The new react-mini api is almost the same as you suggested here.
https://github.com/stoeffel/react-mini#api

import pure from 'react-mini/pure';

const Thing = pure(({name}) => {
  function handleClick(e) {
    console.log(`The name is "${name}".`);
  }
  return (
    <div onClick={handleClick}>look {name}! no state!</div>
  )
});

example @jsbin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment