课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

React and webpack

React and webpack

- [Instructor] I think we're ready for some React. Let's create a React component, and have the system render it. I'm going to resize this terminal here, 'cause we're going to need two terminals for this next task. Close up all the files, and let's create a new file under source, and this time, let's name it index.tsx. .tsx is another special TypeScript extension that signals to TypeScript that this file is going to contain some JSX. And TypeScript will take care of transforming that JSX into vanilla JavaScript. The React component is a simple function. Let's define a constant, and the top-level component is usually named App, and it is a simple JavaScript function that return the description of that component in React's JSS language. For example, let's create a simple div element here, and put a placeholder text in there. So what's going on in here? This syntax here is JSX, it's not JavaScript. It looks weird how we're…

内容