Git Product home page Git Product logo

react-samples's Introduction

React.js Examples

This repo contains a bunch of React.js examples. No server side code, just client-side React components.

Getting started

Make sure you have NPM and Webpack installed before getting started.

  • Install: npm install
  • Build: webpack --watch
  • Start: open src/index.html

Create new samples

  • Fork this repo
  • Create a sample module, e.g. src/js/mysample/mysample-view.js. Your module must export a descriptor like that:
module.exports = {
    name: 'My Sample',
    fn: () => <MySample/>
};
  • Add your sample to src/js/app.js by adding: samples.push(require('./mysample/mysample-view'));

License

MIT

react-samples's People

Contributors

winterbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-samples's Issues

problems running react-samples ..

Let me preface this with ... I'm new to React, so be gentle

When I run:

webpack --watch

I get:

`webpack is watching the files…

Hash: f76b3ed51ab078fb0d0a
Version: webpack 4.23.1
Time: 976ms
Built at: 10/30/2018 8:42:57 PM
2 assets
Entrypoint main = src/bundle.js src/bundle.js.map
[0] ./src/js/app.js 4.58 KiB {0} [built] [failed] [1 error]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in ./src/js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/markj/Downloads/react-samples-master/src/js/app.js: Unexpected token (11:13)

9 | samples.push(require('./grid/grid-view'));
10 |

11 | React.render(

, document.getElementById("nav"));
| ^
at Parser.raise (/Users/markj/Downloads/react-samples-master/node_modules/@babel/parser/lib/index.js:3939:15)`

Does anyone have any idea how I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.