javascript - How does Facebook's React JSX transformer work? -
how possible react allows write jsx (xml) within javascript without throwing errors? have been trying wrap head around it, , not quite sure how underlying code accomplishes this.
simple, looks <script type="text/jsx"> tags, parses them, generates corresponding javascript code, , eval's it.
this why jsx inline transformer should used when developing, having parse jsx code decreases performance of web page. when deploying, should convert jsx code js 1 before deploy.
Comments
Post a Comment