问题描述
我正在学习 React 功能组件并使用 TypeDoc 生成一些文档(也许我不应该使用它)。无论如何,我想以某种方式获得生成的文档中的状态列表(甚至使用的状态),而无需在函数的顶部重复我自己。
我认为看我写的代码是不可能的,因为它基本上是内部注释而不是暴露的东西。
/**
* I don't want to document whatever states here...
*/
const AuthProvider = ({ children }: { children: React.ReactChild }) => {
/**
* OAuth token.
*/
const [authToken,setAuthToken] = useState<OAuthToken | null>(null);
/**
* This state contains the AxiosResponse for the error or null.
*/
const [authError,setAuthError] = useState<AxiosResponse | null>(null);
我希望的是某种文档,例如
AuthProvider
我不想记录这里的任何状态...
状态钩子
-
authToken
(mutatorsetAuthToken()
)OAuth 令牌
-
authError
(mutatorsetAuthError()
)此状态包含错误或空值的 AxiosResponse。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)