This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
export interface Props { | |
name: string; | |
enthusiasmLevel?: number; | |
} | |
function Hello({ name, enthusiasmLevel = 1 }: Props) { | |
if (enthusiasmLevel <= 0) { | |
throw new Error('You could be a little more enthusiastic. :D'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/index.js // | |
import React from 'react'; | |
import { render } from 'react-dom'; | |
import { createStore } from 'redux'; | |
import { Provider } from 'react-redux'; | |
import rootReducer from './reducers'; | |
import App from './containers/App'; | |
const store = createStore(rootReducer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/actions/index.js // | |
// Paprastas objektas su tipu ir perduodama informacija | |
export const addInfo = info => ({ | |
type: 'ADD_INFO', | |
info | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/index.js // | |
import React from 'react'; | |
import { render } from 'react-dom'; | |
import { createStore } from 'redux'; | |
import rootReducer from './reducers'; | |
// sukuriame duombaze | |
const store = createStore(rootReducer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class Komponentas extends Component { | |
constructor(props) { | |
super(props); | |
// mini duombaze | |
this.state = { | |
data: 'informacija' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
var glob = require('glob'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var PurifyCSSPlugin = require('purifycss-webpack'); | |
module.exports = { | |
entry: './src', | |
output: { | |
path: path.resolve(__dirname, './public'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
entry: './src', | |
output: { | |
path: path.resolve(__dirname, './public'), | |
filename: 'index.js' | |
}, | |
module: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Webpack project</title> | |
<link rel="stylesheet" type="text/css" href="/style.css"> | |
</head> | |
<body> | |
<h1>Webpack projektas</h1> | |
<script src="/index.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"scripts": { | |
"dev": "http-server & node_modules/.bin/webpack --watch", | |
}, | |
"dependencies": { | |
"http-server": "^0.11.1", | |
"webpack": "^3.10.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
entry: './src', | |
output: { | |
path: path.resolve(__dirname, './public'), | |
filename: 'index.js' | |
} | |
} |