function ComponentB(props) {
let [state, setState] = useState({title: 'asd'})
return <div>{props.children}</div>;
}
function ComponentA() {
return (
<ComponentB>
{(state???????) => (
<header>{state.title}</header>
)}
</ComponentB>
);
}
function ComponentB(props) {
let [state, setState] = useState({ title: "ТАЙТЛ" });
return <div>{props.children({ state, setState, props })}</div>;
}
function ComponentA() {
return (
<ComponentB url="asd">
{(a) => (
<header>
{a.state.title}
{a.props.url}
</header>
)}
</ComponentB>
);
}