Can be used as a starting point for implementing your own specific check to see if an element is in view.
const YourViewComponent = () => {
const { isInView, inViewRef } = useInView();
return (The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).| // when T is any|unknown, Y is returned, otherwise N | |
| type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
| // when T is never, Y is returned, otherwise N | |
| type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
| // when T is a tuple, Y is returned, otherwise N | |
| // valid tuples = [string], [string, boolean], | |
| // invalid tuples = [], string[], (string | number)[] |
| const http2 = require('http2'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const zlib = require('zlib'); | |
| const brotli = require('brotli'); // npm package | |
| const PORT = 3032; | |
| const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
| const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
| const cache = {}; |
This is a proposal for lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal!
Hi, I am Andy, creator of leakage - the node-powered memory leak testing library.
Instead of manual debugging it provides a structured approach to fix or even prevent memory leaks.
A top-level App component returns <Button /> from its render() method.
What is the relationship between <Button /> and this in that Button’s render()?
Does rendering <Button><Icon /></Button> guarantee that an Icon mounts?
Can the App change anything in the Button output? What and how?
#SOLID-ный JavaScript
##Слайды
##Примеры
##Книги
| //////////////////////////////////////////////////////////////////////// | |
| // Intro | |
| /////////////////////// | |
| // Tools like Redux-saga, React-redux and Reselect can easily be used without Redux | |
| // For Reselet there's nothing to do, it's just not coupled to Redux | |
| // For the others, you just need to provide an adapter | |
| // At Stample.co we use a legacy framework that is quite close to Redux but with a bad API | |
| // We want to progressively migrate to Redux, so starting now to use Redux tools on new features will make our migration faster |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent