466 karma · joined June 8, 2013
[0]: https://ace.c9.io/
Reminder: VirtualDOM is just an optimization of the rerender everything problem.
Maybe a good place to start is with one of those boilerplate repos that have React + build tools already set up: https://github.com/gaearon/react-transform-boilerplate... Then you just add the stack that you want, like redux and react-redux with npm install.
I do like the `handleEvent` convention.
My view is that HTML is just one way of declaring the DOM, but ultimately HTML or some enhanced version of it is just a string. The virtual DOM is another path to constructing the DOM, but instead of a string it's javascript upfront.
For some reason, React’s JSX make this unnecessarily complicated by not being able to use if statements inside code blocks.
Using if inside an expression isn't javascript! It would be some shitty templating language, and I'm grateful it didn't turn out that way."It's NOT a proposal to incorporate JSX into the ECMAScript spec itself. It's intended to be used by various preprocessors (transpilers) to transform these tokens into standard ECMAScript."
Anyway, I really like this article. It pains me every time I have to deal with angular templating.
render() {
return (
<div className='card'>
{this.props.delta > 0 &&
<strong className={this.props.delta > 0 ? 'text-success' : 'text-danger'}>
{this.props.delta}
</strong>
}
{this.props.title}
</div>
);
}