> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Interface: ShakeVisitorConfig

主线程代码的 shake 方式。

## Properties

### pkgName

> **pkgName**: `string`\[]

用于识别需要处理的运行时导入的包名

#### Example

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

export default defineConfig({
  plugins: [
    pluginReactLynx({
      shake: {
        pkgName: ['@lynx-js/react-runtime']
      }
    })
  ]
})
```

#### Default Value

`['@lynx-js/react-runtime']`

#### Remarks

传入的值会与默认值合并，而不是替换默认值。

***

### removeCall

> **removeCall**: `string`\[]

在转换过程中，其调用会被替换为 `undefined` 的函数名

#### Example

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

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

#### Default Value

`['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']`

#### Remarks

传入的值会与默认值合并，而不是替换默认值。

***

### removeCallParams

> **removeCallParams**: `string`\[]

在转换过程中，需要移除其参数的函数名

#### Example

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

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

#### Default Value

`[]`

#### Remarks

传入的值会与默认值合并，而不是替换默认值。

***

### retainProp

> **retainProp**: `string`\[]

需要在组件类中保留的属性

#### Example

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

export default defineConfig({
  plugins: [
    pluginReactLynx({
      shake: {
        retainProp: ['myCustomMethod']
      }
    })
  ]
})
```

#### Default Value

`['constructor', 'render', 'getDerivedStateFromProps', 'state', 'defaultDataProcessor', 'dataProcessors', 'contextType', 'defaultProps']`

#### Remarks

传入的值会与默认值合并，而不是替换默认值。
