Skip to main content

Whitespace

In Ember's Handlebars templates, there's automatic whitespace added between tags by default. However, if you use the ~ in Handlebars, that will override and take up any whitespace (doc). For better and for worse, React has no implied whitespace like this. So migrating the ~ will be easier.

Ember

<span>
<b>Really important:</b>
Use the cheat sheet
</span>

React

Live Editor
const ImportantNews = () => (
	<span>
		<b>Really important:</b>{' '}
		Use the cheat sheet
	</span>
)

render(<ImportantNews  />)
Result
Loading...

Further note