Description
I'm encountering a situation where using reflect to bind a function with multiple arguments only seems to pass the first argument. I'd like to clarify if this is the intended behaviour.
Current Implementation
import { reflect } from "@effector/reflect"
const View = ({ onClick }: { onClick: (first: string, second: number, third: boolean) => void }) => (
<button onClick={() => onClick("first", 1, true)}>Test</button>
)
const Demo = reflect({
view: View,
bind: {
onClick: (first, second, third) => {
console.log("onClick", first, second, third)
// Logs: "onClick", "first", undefined, undefined
},
},
})
Current Behaviour
When calling the bound function with multiple arguments, only the first argument is received:
onClick "first" undefined undefined
Additional Context
- @effector/reflect: 9.2.0
- effector: 23.2.3
- effector-react: 23.2.1
- react: 18
Question
Is this the expected behavior for binding functions with multiple arguments?
Any clarification would be greatly appreciated. Thank you!
Description
I'm encountering a situation where using
reflectto bind a function with multiple arguments only seems to pass the first argument. I'd like to clarify if this is the intended behaviour.Current Implementation
Current Behaviour
When calling the bound function with multiple arguments, only the first argument is received:
Additional Context
Question
Is this the expected behavior for binding functions with multiple arguments?
Any clarification would be greatly appreciated. Thank you!