Skip to content

Minimal React project with example components and links to further reading

Notifications You must be signed in to change notification settings

mikeperri/react-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#React Examples This project has an example build setup (bundler and test framework) and some example components. You can use it as a base for your React project.

##Get started Run the build and start the Webpack dev server with:

npm start

As with any node project, see the package.json "scripts" key for more commands.

##Included in this project ###React Getting started with React: https://facebook.github.io/react/docs/getting-started.html

###Bundler - Webpack This project builds with Webpack. Webpack takes all the JavaScript files in the src/ directory, performs transformations on them (ES2015 and JSX), and outputs them as one compiled JS file, bundle.js. It also provides a simple server that watches for changes and reloads the page automatically.

I also included html-webpack-plugin to generate the index.html file with the bare minimum elements and a script tag for the bundle.js file that Webpack created.

An alternative to Webpack would be Browserify. Read some of these links to learn about Webpack vs Browserify.

###Test Frameworks - Mocha & Enzyme This project includes mocha, chai, and sinon for general testing, enzyme for querying React components, and chai-enzyme for assertions about React components.

Another option would be Facebook's Jest, which is built on the Jasmine framework.

Further reading:

##Not included ###Server The webpack-dev-server is included, but it is not meant for production environments. Consider using Hapi or Express. Also note that React apps can be rendered on the server side to improve performance.

###Styles The example components in this project have no styles. You can use stylesheets or put inline styles directly in the JSX.

About

Minimal React project with example components and links to further reading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published