![]() In this environment, every time you perform a build, all of your JSX is automatically converted into JS and placed on disk for you to reference like any plain JavaScript file. Set up a development environment around Node and a handful of build-tools.Fortunately, there are two solutions to this: If we didn't do this, our React app simply won't work. ![]() To build a web app using React, we need a way to take our JSX and convert it into plain old JavaScript that your browser can understand: ![]() Your browser has no idea what to do with JSX. That sounds cool and all (and we will see JSX in action in just a few moments), but there is a slight problem. JSX is a language that allows you to easily mix JavaScript and HTML-like tags to define user interface (UI) elements and their functionality. Besides normal HTML, CSS, and JavaScript, the bulk of your React code will be written in something known as JSX. ![]() Now, here is where the specialness of React comes in. Otherwise, your browser really won't know what to do. The end result has to be some combination of HTML, CSS, and JavaScript. It doesn't matter if your web app was written using React or some other library like Angular, Knockout, or jQuery. React is annoyingly special that way, and it has to do with how React apps are built.Īs you know, your web apps (and everything else your browser displays) are made up of HTML, CSS, and JavaScript: It isn't very happy when you simply refer to code you've written for it using a script tag. React isn't like many JavaScript libraries you may have used. BUY ON AMAZON Dealing with JSXīefore we start building our app, there is an important thing we should cover first. To kick your React skills up a few notches, everything you see here and more (with all its casual clarity!) is available in both paperback and digital editions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |