I've been wondering: When you create a function like the following:
const someFunction = (paramOne, paramTwo, paramThree) => {
// some code
}
And then pass it down to a component as a prop:
<SomeComponent somePropName={someFunction} />
And in said component, you call it with 2 arguments:
props.somePropName('value1', 'value2')
While the function's signature describes three arguments. Would there be any way to 'fill in' the third argument of said function in the main component, instead of the component where it's been passed down to:
<SomeComponent somePropName={someFunction(passedByComponent, passedByComponent, iWantToFillThisOneInManually)} />
The main reason I'd want this, is because sometimes I have data available in one file and other data in the other, while I do need both in the function.
Anyone have any experience doing something like this?
Thanks in advance!
Small note: Before shaking the brain bush, I'm not entirely sure if this is even possible :/