Skip to content

Instantly share code, notes, and snippets.

@trueadm
Created October 18, 2017 14:36
Show Gist options
  • Save trueadm/82bdc34bcdc5779c1c17750ad2ba4a34 to your computer and use it in GitHub Desktop.
Save trueadm/82bdc34bcdc5779c1c17750ad2ba4a34 to your computer and use it in GitHub Desktop.
function __$createComponent() {
...
}
class MyComponent extends React.Component {
render(props) {
return [props.className, 0, props.items.length, __$createComponent]
}
_bytecode = [
OPEN_ELEMENT_DIV,
PROP_CLASSNAME, 'container',
CREAT_ELEMENT_UL,
PROP_CLASSNAME, 0, // render [0]
OPEN_FOR_LOOP,
1, // render [1]
2, // render [2]
LOOP_INCREMENT,
OPEN_BLOCK,
COMPONENT, 3, // render [3]
CLOSE_BLOCK,
CLOSE_FOR_LOOP,
CLOSE_ELEMENT_UL,
CLOSE_ELEMENT_DIV,
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment