// https://stackoverflow.com/questions/61488512/react-does-not-recognize-the-prop-passed-to-a-styled-component-within-material-u
const Text = styled( ({textColor, textSize, ...rest}) => <Typography {...rest}/>)margin-bottom: 10px; color: ${({ textColor }) => textColor ?? textColor}; font-size: ${({ textSize }) => (textSize ? textSize + "px" : "16px")};
;
This file contains 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
// See: https://egghead.io/lessons/javascript-redux-persisting-the-state-to-the-local-storage | |
const loadState = () => { | |
try { | |
const serializedState = localStorage.getItem('state'); | |
if (serializedState === null) { | |
return undefined; | |
} | |
return JSON.parse(serializedState); | |
} catch (err) { |
Config Split allows user to define a set of configuration files that get exported to a different directory from the rest of the config files. When that split is active, config files in that directory override values in the default set.
Example 1: the views_ui module should be enabled on dev environment only and aggregation should be disabled there.
- drush cex;
- Create a new split (admin/config/development/configuration/config-split), i.e. dev and enable it;
- Add views_ui module to a blacklist and system.performance configuration to a greylist;
- Change aggregation configuration;
- drush cex.
This file contains 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'; | |
import { Redirect, BrowserRouter, Route, Switch } from "react-router-dom"; | |
function App() { | |
let auth = false; | |
return ( | |
<BrowserRouter> | |
<Switch> |
A generator allows you to write code that uses foreach to iterate over a set of data without needing to build an array in memory, which may cause you to exceed a memory limit, or require a considerable amount of processing time to generate.
<?php
/**
* Helper function to get $count of even numbers.
*/
function func($count) {
<?php
class MyClass {
private function somePrivateMethod() {
echo 'This method is private!';
}
}
NewerOlder