from Hacker News

Show HN: Write React Hooks with Classes

by wishawa on 3/21/22, 10:41 PM with 1 comments

  • by wishawa on 3/21/22, 10:47 PM

    Hi HN! Hooks Considered Harmful [0] is being discussed so I thought I should share this library I made.

    Normally React hooks are written with functions but with this library you use classes instead. You have access to lifecycle methods such as `hookDidMount` and `hookDidUpdate`.

    I hope people find this interesting. Whether or not it is a good design is something for y'all to debate!

    [0]: https://news.ycombinator.com/item?id=30753127