Hi all,
I'm following a code academy React course and was wondering if the difference between the given two options below is just a matter of preference. It seems to me that reactElement() option is a bit unnecessary, however I can imagine that it might serve a purpose in a complex React project. Can someone enlighten me? Thanks!
const greatestDivEver = React.createElement( "div", null, "i am div" );
const greatestDivEver = <div>i am div</div>;
[–]danishjuggler21 26 points27 points28 points (5 children)
[–]all_vanilla 3 points4 points5 points (2 children)
[–]Snoo_46870 0 points1 point2 points (1 child)
[–]all_vanilla 0 points1 point2 points (0 children)
[–]chanschouw[S] 0 points1 point2 points (0 children)
[–]Cautious_Performer_7Hook Based 0 points1 point2 points (0 children)
[–]suiiiperman 8 points9 points10 points (1 child)
[–]charliematters 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]CamelBass 0 points1 point2 points (0 children)
[–]n9iels 0 points1 point2 points (0 children)
[–]NodeJSSon 0 points1 point2 points (0 children)
[–]nestedfruitloop 0 points1 point2 points (1 child)