Generic Components: React + TypeScript: A Match Made in Heaven

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 3

  • @devoptimist
    @devoptimist 2 місяці тому

    It's a nice demo, thanks. It would also be cool to see more of a production use case. The problem you talked about with forms sounded interesting but I'm not able to visualize how you'd use generic components in that situation.

    • @codingwithlulu
      @codingwithlulu  2 місяці тому

      Glad you like the demo and hopefully it will be helpful. Production ready examples can only reproduce in real time but will try my best recreate a scenario and share in future videos

  • @王永庆-w4k
    @王永庆-w4k 2 місяці тому

    can also use it :React.FC:
    import { FC } from 'react';
    const List: FC = ({ items, renderItem }) => {
    return (
    {items.map((item, index) => (
    {renderItem(item)}
    ))}
    );
    };