Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Basics (2018) First Steps in React Create a React Element

emi sastra
emi sastra
37 Points

Can not find/open browser console at VS Code

After I wrote code at app.js as shown in video. But I do not know how to use browser console.

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Emi,

To open the console in the browser (assuming you're following along in Google Chrome) use Ctrl + J shortcut. That'll give you access to the console tab. Later all when you download the extension you'll get the React tab as well which will allow you to analyse props and state.

If you're using the Terminal/Console in VS Code, you can open it using the Terminal menu, ---> New Terminal.

emi sastra
emi sastra
37 Points

Hi Jonathan,

Thank you for reply.

At new terminal, I just see powershell and bash. What should I do ?

Thank you.

Ezra Siton
Ezra Siton
12,644 Points

Open the browser console "how to"

  1. Video screen ==> "Launch workspace"
  2. Go to app.js file write this code and save:
const title = React.createElement(
  'h1',
  { id: 'main-title', title: 'This is a title.'},
  'hello my first react'
);

console.log(title);

Preview workspace

  1. workspace-Top right-corner click on the eye-icon (Preview workspace)
  2. Browser (chrome in my case) - right-click --> inspect (Or: ctrl + shift + i)
  3. Go to the console tab (The output):
Object

https://teamtreehouse.com/library/using-treehouse-workspaces