TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Write React Hooks with Classes

3 点作者 wishawa大约 3 年前

1 comment

wishawa大约 3 年前
Hi HN! Hooks Considered Harmful [0] is being discussed so I thought I should share this library I made.<p>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`.<p>I hope people find this interesting. Whether or not it is a good design is something for y&#x27;all to debate!<p>[0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30753127" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30753127</a>