JSX and double brackets

December 05, 2020

In JavaScript, JSX double brackets {{ foo: bar }} are used

when passing object literals to an element.

Example:

// for example, when passing the color attribute to style inline, as an object literal

<div style={{ color: blue}}></div>

JSX is a syntax extension to JavaScript.

For more on JSX: https://reactjs.org/


Disclaimer: All views expressed on this blog are solely my own, and do not represent the opinions of any entity i am affiliated with.
© 2021, Built with