Skip to content

Instantly share code, notes, and snippets.

{
"version": 8,
"name": "Red Ocean Minimal",
"sources": {
"openmaptiles": {
"type": "vector",
"url": "https://api.maptiler.com/tiles/v3/tiles.json?key=3LCncSsql2eNSaoGu4SP"
}
},
"glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key=3LCncSsql2eNSaoGu4SP",
@matthiasp42
matthiasp42 / ApplyPropsToAllChildren
Last active January 20, 2020 08:12
Recursively updates all children with props. Can be handy but maybe hard to debug due to non-declarative approach and another developer may not expect it to work like this.
import React, { ReactNode } from 'react'
interface Props {
propsForChildren: any
}
const ApplyPropsToAllChildren: React.FunctionComponent<Props> = (props) => {
return <>{recursiveMap(props.children, props.propsForChildren)}</>
}
export default ApplyPropsToAllChildren
@matthiasp42
matthiasp42 / LazyTooltip.js
Created June 20, 2018 14:57
Improves "material-ui"-Tooltip performance by only rendering it when the mouse is actually on an element.
//@flow
import React from 'react';
import Tooltip from "@material-ui/core/Tooltip";
type Props = {
title: string
}
type State = {
mouseOverCounter: number