+ 1

React error

Hello everyone. I have just started learning react and i tried to create a simple render function on sololearn but it is showing this error. Check this code https://code.sololearn.com/W6Lnl42uTF9R/?ref=app Tell me if there is any way to write react on sololearn.

4th Dec 2021, 11:23 AM
Adnan Ur Rehman
Adnan Ur Rehman - avatar
3 odpowiedzi
+ 1
In the script tag where you render the elements, add this attribute : type="text/babel" Bye
4th Dec 2021, 12:31 PM
VCoder
VCoder - avatar
+ 1
As JSX is part from Babel, and Babel is a JS compiler, you must specify that you want to use it with the type attribute
4th Dec 2021, 1:48 PM
VCoder
VCoder - avatar
0
Thank you so much. It's working now.
4th Dec 2021, 1:43 PM
Adnan Ur Rehman
Adnan Ur Rehman - avatar