https://github.com/timarney/react-app-rewired
// config-overrides.js
const babelLoader = function(conf) {
if (!conf.loader) return false;
return conf.loader.indexOf('babel-loader') > -1;
};
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; | |
/*#box1 { | |
background: red; | |
height: 20px; |
#include <iostream> | |
#include <math.h> | |
#include <vector> | |
using namespace std; | |
void merge(vector<int> out, vector<int> left, vector<int> mid, vector<int> right){ | |
vector<int> temp (out.size()); | |
int total = 0; | |
int lft = 0; | |
int md = 0; |
#include <iostream> | |
using namespace std; | |
int change(int n){ | |
int val = n; | |
int num = 0; | |
while(val > 0){ | |
if(val > 50){ | |
num = num + 1; |
/** | |
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
* load <script nomodule> anyway. This snippet solve this problem, but only for script | |
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
* | |
* Again: this will **not** prevent inline script, e.g.: | |
* <script nomodule>alert('no modules');</script>. | |
* | |
* This workaround is possible because Safari supports the non-standard 'beforeload' event. | |
* This allows us to trap the module and nomodule load. |
class Comp extends Component { | |
handleClick = (...args) => e => { | |
console.log(args, e); | |
} | |
render() { | |
return <button onClick={this.handleClick('args')}>Click Me</button>; | |
} | |
} |
@mixin FeatureComponentA() { | |
.FeatureComponentA { | |
color: $Feature-color; | |
border-radius: $Feature-radius; | |
} | |
} |
:root { | |
--fontFamilies: -apple-system, | |
BlinkMacSystemFont, | |
"Segoe UI", | |
Roboto, | |
Oxygen-Sans, | |
Ubuntu, | |
Cantarell, | |
"Helvetica Neue", | |
sans-serif; |
import React, { Component } from 'react'; | |
import { render } from 'react-dom'; | |
const connect = ( | |
mapStateToProps, | |
mapDispatchToProps = {}, | |
) => WrappedComponent => { | |
return class ConnectedComponent extends Component { | |
render() { | |
return ( |
https://github.com/timarney/react-app-rewired
// config-overrides.js
const babelLoader = function(conf) {
if (!conf.loader) return false;
return conf.loader.indexOf('babel-loader') > -1;
};
/* | |
Lets say you want to adopt react into an old app that is using some other framework | |
without re-writing all of the app in one go you decide to go step by step. | |
Now lets also say that you want to be able to compose the entire app in one | |
component/state tree. However you have a chunk of it that you know you don't want to | |
change over just yet: | |
<Old App> |