Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use curly brackets without it being an expression in react

Tags:

reactjs

jsx

I need to have something like

<p>{</p>
// code
<p>}</p>

How can i use the curly parenthesis without it erroring and say expression needed? Is there an escape character that i can use? i.e. "\""

like image 736
Strahinja Ajvaz Avatar asked Dec 14 '22 18:12

Strahinja Ajvaz


1 Answers

Well, this is a pretty solution. use the same curly brackets for display curly brackets.

 {'{'} {'}'}
like image 71
Kenry Sanchez Avatar answered Dec 17 '22 22:12

Kenry Sanchez