Is fastclick js still needed?

This article explains in detail why and when you need fastclick.js: https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away TL;DR As of Chrome 32 (back in 2014) this delay is gone for mobile-optimised sites, without removing pinch-zooming! Firefox and IE/Edge did the same shortly afterwards, and in March 2016 a similar fix landed in iOS 9.3. As long as your <head> includes: … Read more

How to detect if screen size has changed to mobile in React?

What I did is adding an event listener after component mount: componentDidMount() { window.addEventListener(“resize”, this.resize.bind(this)); this.resize(); } resize() { this.setState({hideNav: window.innerWidth <= 760}); } componentWillUnmount() { window.removeEventListener(“resize”, this.resize.bind(this)); } EDIT: To save state updates, I changed the “resize” a bit, just to be updated only when there is a change in the window width. resize() … Read more

How can I respond to the width of an auto-sized DOM element in React?

The most practical solution is to use a library for this like react-measure. Update: there is now a custom hook for resize detection (which I have not tried personally): react-resize-aware. Being a custom hook, it looks more convenient to use than react-measure. import * as React from ‘react’ import Measure from ‘react-measure’ const MeasuredComp = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)