Skip to content

Instantly share code, notes, and snippets.

@wojciech-bilicki
Created July 23, 2017 13:53
Show Gist options
  • Save wojciech-bilicki/626feee42f43feb1f36c4a5a75b68694 to your computer and use it in GitHub Desktop.
Save wojciech-bilicki/626feee42f43feb1f36c4a5a75b68694 to your computer and use it in GitHub Desktop.
#2 Index.js with props
var topBarTitle = function(props) {
return React.createElement('p', { style: props.style }, props.title);
};
var topBar = function() {
return React.createElement(
'div',
{ style: { color: 'red' } },
React.createElement(topBarTitle, {
title: 'SpiderMan Hero',
style: { color: 'blue' }
}),
React.createElement(topBarTitle, { title: 'IronMan Hero' }),
React.createElement(topBarTitle, {
title: 'Hulk Hero',
style: { color: 'green' }
})
);
};
ReactDOM.render(React.createElement(topBar), document.getElementById('app'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment