var cart = JSON.parse(localStorage.getItem('cart')) || [];
cart.push(element);
localStorage.setItem("cart", JSON.stringify(cart));
import React, { Component } from 'react';
import { render } from 'react-dom';
render(
<h1>djkkdkdk</h1>,
document.getElementById("root")
);
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>djkkdkdk</h1>,
document.getElementById("root")
);
module.exports = {
context: __dirname + '/src',
entry: './test',
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /\/node_modules\//,
use: [
{
loader: 'babel-loader',
options: {
presets: ['es2015', 'stage-0', 'react']
}
}]
},
],
},
};
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: '[name].js',
},
const mapDispatchToProps = {
editUser,
};
connect(null, mapDispatchToProps)(Component);