Arc*_*ano 5 typescript reactjs typedoc
我正在学习 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);
Run Code Online (Sandbox Code Playgroud)
我希望的是某种文档,例如
我不想在这里记录任何状态......
authToken(突变体setAuthToken())
OAuth 令牌
authError(突变体setAuthError())
此状态包含错误或空值的 AxiosResponse。
| 归档时间: |
|
| 查看次数: |
305 次 |
| 最近记录: |