Как правильно выполнить типизацию кода на React (children и ответ при асинхронном запросе)?

Подскажите пожалуйста, как правильно выполнить типизацию следующего кода? Моменты, которые наиболее интересуют, это типизация children:

type TwitterProps = {
    children: any,
}

И что важно, как типизировать ответ при асинхронном запросе?

interface ITwitter {
    userId: number,
    id: number,
    title: string,
    completed: boolean,
}

const response = await fetch(url).then(response => response.json());

Ex.1

import React, {useState, useCallback, ReactFragment} from 'react';
import './App.css';

const url = 'https://jsonplaceholder.typicode.com/todos/1';

function Loading() {
    return <div>Loading</div>
}

type BadgeProps = {
    info: string
}

function Badge({info}: BadgeProps) {
    return (
        <div>
            <p>{info}</p>
            <p>Badge</p>
        </div>
    )
}

interface ITwitter {
    userId: number,
    id: number,
    title: string,
    completed: boolean,
}

type TwitterProps = {
    // children: React.ReactNode,
    children: any,
}

type TwitterState = {
    userId: string | null
}

class Twitter extends React.Component<TwitterProps, TwitterState> {

    constructor(props: TwitterProps) {
        super(props);

        this.state = {
            userId: null,
        }
    }

    /*
    state = {
        userId: null
    }

     */

    async componentDidMount() {
        const response = await fetch(url).then(response => response.json());
        console.log(response);

        const {userId} = response;

        this.setState({userId})
    }

    render() {
        console.log(this.props);

        const {children} = this.props;
        const {userId} = this.state;

        return children(userId);
    }
}

class App extends React.Component<{}, {}> {

    render() {
        return (
            <Twitter>
                {
                    (user: string) => user === null
                        ? <Loading/>
                        : <Badge info={user}/>
                }
            </Twitter>
        )
    }
}

Ответы (0 шт):