Somewhere inside your code (in my case, is a custom react hook, for example usePress from yandex )
const attach = (target: T, id: number) => {
cache.currentPointerTarget = target;
cache.currentPointerId = id;
cache.isPressed = true;
disableTextSelection();
setPressed(true);
};
// ..
attach(event.currentTarget, event.pointerId);
What is the current behavior:
effector/babel-plugin mutate at least first parameter target when function with the same name as api method get called
So, target in this example instead of and DOM element is transformed into
{
and: DOM ELEMENT HERE,
or: {sid: xxx}
}
What is the expected behavior:
The source code of the corresponded file does not change if the function that is used
- is defined in the same file
- imported from anywhere exc. effector, even if the name of this function is the same as the name of one of the effector API methods.
Which versions of effector packages, and which browser and OS are affected by this issue? Did this work in previous versions of effector?:
Latest Effector version.
The only workaround for now is to manually rename all source files that contains the same function names as effector API (not sure if all, but at least attach)
Somewhere inside your code (in my case, is a custom react hook, for example usePress from yandex )
What is the current behavior:
effector/babel-pluginmutate at least first parametertargetwhen function with the same name as api method get calledSo,
targetin this example instead of and DOM element is transformed intoWhat is the expected behavior:
The source code of the corresponded file does not change if the function that is used
Which versions of effector packages, and which browser and OS are affected by this issue? Did this work in previous versions of effector?:
Latest Effector version.
The only workaround for now is to manually rename all source files that contains the same function names as effector API (not sure if all, but at least
attach)