react関連コンポーネントとテクノロジースタック
2764 ワード
ここでは具体的な使い方を簡単に列挙するだけです.
Suspense
);
}
react-document-title
memoize-one
react-container-query
classnames
path-to-regexp
react-media
未完待機
Suspense
lazy
import React, {lazy, Suspense} from 'react';
const OtherComponent = lazy(() => import('./OtherComponent'));
function MyComponent() {
return (
Loading...
}>);
}
react-document-title
/*
react-document-title
title
*/
import DocumentTitle from 'react-document-title';
return (
{/*
class
*/}
{params => (
{layout}
)}
}>{this.renderSettingDrawer()}
);
memoize-one
memoize-one
memoizeOne(resultFn, isEqual)
, === 。
react-container-query
/*
react-container-query
https://www.npmjs.com/package/react-container-query
query
props.children
{params => (
{layout}
)}
*/
import { ContainerQuery } from 'react-container-query';
classnames
/*
https://github.com/JedWatson/classnames
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', { bar: true }); // => 'foo bar'
classNames({ 'foo-bar': true }); // => 'foo-bar'
classNames({ 'foo-bar': false }); // => ''
classNames({ foo: true }, { bar: true }); // => 'foo bar'
classNames({ foo: true, bar: true }); // => 'foo bar'
// lots of arguments of various types
classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux'
// other falsy values are just ignored
classNames(null, false, 'bar', undefined, 0, 1, { baz: null }, ''); // => 'bar 1'
*/
path-to-regexp
/*
*/
import pathToRegexp from 'path-to-regexp';
react-media
/*
,
*/
import Media from 'react-media';
未完待機