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
import { useEffect, useRef } from 'react' | |
export function useWhyDidYouUpdate(name: string, props: Record<string, any>) { | |
const latestProps = useRef(props) | |
useEffect(() => { | |
const allKeys = Object.keys({ ...latestProps.current, ...props }) | |
const changesObj: Record<string, { from: any; to: any }> = {} | |
allKeys.forEach(key => { |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
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
module.exports = { | |
plugins: [require.resolve('./sitePlugin')], | |
} |
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
import type { Attribute, Common, Utils } from '@strapi/types'; | |
type IDProperty = { id: number }; | |
type InvalidKeys<TSchemaUID extends Common.UID.Schema> = Utils.Object.KeysBy< | |
Attribute.GetAll<TSchemaUID>, | |
Attribute.Private | Attribute.Password | |
>; | |
export type GetValues<TSchemaUID extends Common.UID.Schema> = { |
Although @setup/node as a built-in cache option, it lacks an opportunity regarding cache persistence. Depending on usage, the action below might give you faster installs and potentially reduce carbon emissions (♻️🌳❤️).
Yarn 3+/4+ with nodeLinker: node-modules. (Not using yarn ? see the corresponding pnpm 7/8+ action gist)
OlderNewer