I just used a library called react-axios where a function is supplied inside of a component in the following way:
<Get url="/api/user" params={{id: "12345"}}>
{(parameters) => {
//some callback with the parameters
}}
</Get>
As I have never seen this syntax before and always passed functions with props, I am curious:
- How is this type of function-specification called in React?
- How can a Component be implemented like this?
- Does it also work with function-components?