这是开发预览网站。请访问正式文档 lynxjs.org

Home > @lynx-js/react-rsbuild-plugin > ShakeVisitorConfig > removeCall

ShakeVisitorConfig.removeCall property

Function names whose calls should be replaced with undefined during transformation

Signature:

removeCall: Array<string>

Remarks

Default value: ['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle'] The provided values will be merged with the default values instead of replacing them.

Example

import { defineConfig } from '@lynx-js/rspeedy'
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'

export default defineConfig({
  plugins: [
    pluginReactLynx({
      shake: {
        removeCall: ['useMyCustomEffect']
      }
    })
  ]
})