Use Codesandbox to Start a New React Application

Joel Hooks
InstructorJoel Hooks
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 3 years ago

codesandbox.io provides one of the fastest ways to start a new React project. In this lesson, we will take a first look at codesandbox, its interface, and the default React project it creates.

Instructor: [00:00] We're going to use codesandbox.io to create a new React project. When you first open CodeSandbox, you'll see it provides you with this constellation of cubes spinning in space over here. Each of these cubes represents a different kind of template that you can open a new CodeSandbox with.

[00:18] We want to start with React. I'm going to go ahead and click the blue cube and then say, "Open React." Inside of a new CodeSandbox, you have three different panes. On the left-hand side, you see your project configuration.

[00:32] This includes things like the template that was used to create this project, the files that exist within that template that are created automatically for you as well as a list of dependencies that your template provided you with to start out with. You can see in this case we used Create React App to start the project. That's something that CodeSandbox does under the hood for you.

[00:51] It created several files including an index.js, a styles.css, and those are both in the source folder, and a package.json. We can look at each of these independently in the center view, which is our file view. This gives us a fairly typical tabbed interface that we might be used to from our favorite code editors.

[01:10] Inside of those, you can see we get syntax highlighting and all that nice stuff that we expect from a full featured editor, which CodeSandbox totally is.

[01:19] On the right-hand side, you can see this output window. The output window has several options. We're showing the browser right now. You can see, "Hello CodeSandbox. Start editing to see some magic happen."

[01:28] We'll go ahead and listen to that. We'll say, "The magic is real." You'll see that updates instantly, almost, over in your browser window. That's pretty nice. In addition, we have a console, so you can do things like console.log, hello world. You can see the console actually logs.

egghead
egghead
~ 13 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today