Giter Club home page Giter Club logo

Learning some React

Just playing around and learning myself some React. http://react-per.surge.sh

#Basic setup Webpack, Babel, React:

  • Create an empty folder
  • To initialize folder for npm, write:
    npm init
  • Install Webpack globally, write:
    nmp install --save-dev webpack -g
  • Install Babel, write:
    npm install --save-dev babel-cli babel-loader babel-core babel-preset-es2015
  • Create a file in the folder called .babelrc (with the initial dot!)
  • In that file, write:
    { 'presets': ['react', 'es2015'] }
  • Install React, write:
    npm install --save react react-dom babel-preset-react
  • Create a file called webpack.config.js and include the following in it:
module.exports = {
    context: __dirname + "/",
    entry: "./index.js",
    output: {
        path: __dirname + "/dist",
        filename: "bundle.js"
    },
    module: {
        loaders: [{
            exclude: /node_modules/,
            loaders: ['babel-loader']
        }]
    }
};
  • Create a file called index.js and include the following in it:
var React = require('react');
var ReactDOM = require('react-dom');

ReactDOM.render(
  <h1>Hello World!</h1>,
  document.getElementById('example')
);
  • Create a file called index.html and include the following in it:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>A title</title>
  </head>
<body>
    <div id="example"></div>
    <script src="dist/bundle.js"></script>
</body>
</html>
  • Just run the command webpack and a file called bundle.js should have been created in folder dist
  • Open index.html in a webbrowser!

Per Ackelman's Projects

brewapp icon brewapp

App to log and help you with your beer home brewing

d3 icon d3

PLaying around with D3 and SVG

di-pwa icon di-pwa

Testing some Progressive Web App

eurovision icon eurovision

Small app for guests to vote in the Eurovision Contest

hackday2017 icon hackday2017

During Hackday May 2nd we made this app as a dashboard to list incoming chats from customer service.

heroku icon heroku

Node.js Express app connected to my Heroku-account

labef icon labef

Another repo playing with Entity Framework

net-core icon net-core

doing some .Net Core stuff with Docker and Azure

persapp icon persapp

React Native experimental mobile app

persyl.github.io icon persyl.github.io

A repo to get it shown on Github.io website, built with React and Redux

quiz icon quiz

Quiz-app for an after work I had

scubahub icon scubahub

ASP.Net MVC site with SQL-server and Entity Framework, published in Azure

teststuffwithioc icon teststuffwithioc

Project where I can learn stuff and just try different techniques like IoC, MVC, LESS, WebAPI etc etc.

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.