DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • 3 Easy Steps for a (Dev)Containerized Microservice With Jolie and Docker
  • Creating Application using Spring Roo and Deploying on Google App Engine
  • No Code Expectations vs Reality
  • Extending the Salesforce CLI with a Custom Plugin

Trending

  • How To Develop a Truly Performant Mobile Application in 2025: A Case for Android
  • Agile and Quality Engineering: A Holistic Perspective
  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 1
  • Unmasking Entity-Based Data Masking: Best Practices 2025
  1. DZone
  2. Coding
  3. JavaScript
  4. C# Developer's Guide to React.js (Part 1): Create and Run

C# Developer's Guide to React.js (Part 1): Create and Run

A guide to React for someone that understands programming, but doesn't know anything about working with React.js.

By 
Paul Michaels user avatar
Paul Michaels
·
May. 17, 19 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
23.8K Views

Join the DZone community and get the full member experience.

Join For Free

I thought it might be time for another of my patented "C# Developer's Guide to..." Basically, a guide to React for someone that understands programming (C# ideally), but doesn't know anything about React.js.

There are a couple of VS templates for React; however, after working with it for a while, you realize that most of the React people live in the command line; there's a tool called create-react-app.

You can use Powershell or Bash as your command line of choice. Start by installing the tool:

npm i -g create-react-app

This assumes that you have installed npm.

Create a React.js Application

To create a new application, navigate to the directory in which you wish to create the application and type:

create-react-app [app-name]

For example:

create-react-app context-menu-test
create-react-app
create-react-app

Once created, it tells you how you can start the app:

React App Directory
React App Directory

Run Your React.js Application

First, navigate into the directory that it's just created (otherwise, you'll get errors when you run).

npm start

This will launch the server, and navigate to the URL with the default browser:

cd context-menu-test
npm start

This runs on port 3000 by default, so if you run a couple of instances then you might get the error:

Something is already running on Port 3000

To fix this, in VS Code, open the folder:

node_modules/react-scripts/scripts/start.js

Find the following line (at the time of writing):

const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;

You can change the port 3000 to something that's free.

Edit App.js:

class App extends Component {
  render() {
    return (
      <div className="App">
        <div>
          <p>Test</p>
        </div>
      </div>
    );
  }
}

Save and see the updated screen appear (which I think you'll agree is much better than the default screen).



If you enjoyed this article and want to learn more about React, check out this collection of tutorials and articles on all things React.

application React (JavaScript library) app Directory Virtual screening Command (computing) PowerShell Template Npm (software)

Published at DZone with permission of Paul Michaels, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • 3 Easy Steps for a (Dev)Containerized Microservice With Jolie and Docker
  • Creating Application using Spring Roo and Deploying on Google App Engine
  • No Code Expectations vs Reality
  • Extending the Salesforce CLI with a Custom Plugin

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!