This file contains hidden or 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
// imports whole library | |
import { Label, Input, TextArea } from '@inplayer-org/inplayer-ui'; | |
// imports whole library too | |
// because the *src/index.js* from the library imports/exports Label component | |
import { Label } from '@inplayer-org/inplayer-ui'; | |
// imports Label as standalone component | |
// without import whole library | |
import Label from '@inplayer-org/inplayer-ui/lib/Label';; |
This file contains hidden or 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
// Assuming A through D are all regular React component declarations... | |
// components/A.js | |
export default function A() { | |
return <div>Hello, World!</div> | |
} | |
// Use React.lazy to create a dynamically loaded version of the component | |
// components/index.js | |
export const A = React.lazy(() => import(/* webpackChunkName: "top" */ "./A")); | |
export const B = React.lazy(() => import(/* webpackChunkName: "top" */ "./B")); |
Type | Title | About | Project or url | Env |
---|---|---|---|---|
e.g. Bug report |
e.g. Login Issue |
e.g. Unable to login |
e.g Merchant Panel |
e.g. Staging |
useState: Persist value between renders, trigger re-render useRef: Persist value between renders, no re-render useEffect: Side effects that run after render useReducer: useState in reducer pattern useMemo: Memoize value between renders useCallback: Persist ref equality between renders
This file contains hidden or 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
const object = { id: 123, names: { first: 'Srdjan', last: 'Rakic' }}; | |
// With lodash's `_.get`: | |
const firstName = _.get(object, 'names.first'); // -> 'Srdjan' | |
const middleName = _.get(object, 'names.middle' : '(no middle name)'); // -> '(no middle name)' | |
// with optional chaining and nullish coalescing: | |
const firstName = object?.names?.first ?? '(no first name)'; // -> 'Srdjan' | |
const middleName = object?.names?.middle ?? '(no middle name)'; // -> '(no middle name)' |
NewerOlder