javascript - What does JSX stand for? -
what jsx stand for?
i referring jsx defined xml-like syntax extension ecmascript, has become quite popular increasing popularity of reactjs.
jsx stands javascript xml. react, it's extension xml-like code elements , components. per react docs , mentioned:
jsx xml-like syntax extension ecmascript without defined semantics
from quote above, can see jsx doesn't have defined semantics, it's extension javascript allows write xml-like code simplicity , elegance, , transpile jsx pure javascript function calls react.createelement
. per react tutorial:
jsx preprocessor step adds xml syntax javascript. can use react without jsx jsx makes react lot more elegant.
just xml, jsx tags have tag name, attributes, , children. if attribute value enclosed in quotes, value string. otherwise, wrap value in braces , value enclosed javascript expression.
any code in jsx transformed plain javascript/ecmascript. consider component called login
. render jsx:
<login foo={...} bar={...} />
as can see, jsx allows have xml-like syntax tags, representing components , elements in react. it's transpiled pure javascript:
react.createelement(login, { foo: ..., bar: ... });
you can read more at docs.
Comments
Post a Comment