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