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

# Interface: ShakeVisitorConfig

How main-thread code will be shaken.

## Properties

### pkgName

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

Package names to identify runtime imports that need to be processed

#### 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

The provided values will be merged with the default values instead of replacing them.

***

### removeCall

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

Function names whose calls should be replaced with `undefined` during transformation

#### 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

The provided values will be merged with the default values instead of replacing them.

***

### removeCallParams

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

Function names whose parameters should be removed during transformation

#### 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

The provided values will be merged with the default values instead of replacing them.

***

### retainProp

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

Properties that should be retained in the component class

#### 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

The provided values will be merged with the default values instead of replacing them.
