-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Props not being generated for Type #1307
Comments
Hello @stramel This is probably because you didn't add a tsconfig.json to your project. Try running You can also check the typescript example : npx create-docz-app my-app --example typescript Going to close this, please feel free to re-open if the suggestions above don't work. |
@rakannimer Sorry, I attempted to make a reproduction for this but my actual use-case is in a NX monorepo. I have a base I'm unable to re-open the issue since you closed it. |
Hi @rakannimer I think I'm encountering a similar issue. My setup is a monorepo (without any supporting tools like Lerna or Yarn Workspaces) with Typescript support. It contains a Here's a sample repo with instructions. Your help would be appreciated as always! |
We are having the same issue in a mono repo as well ... tried most things ... next step I guess is to take a look at the source code and debug 🗡 Funny, but the flow package works ... the typing is correct. |
I fixed, after my comment, changing the typescript code (before I didnt add the type to the component as React.SFC) and adding a tsconfig in the root of the repo.
|
I seem to have a problem getting props from when I'm extending other interfaces.. For example I have this scenario.
The component works fine in I have tested other components that use a straight interface for props and those work with |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still very much an issue |
I am encountering the same thing in a monorepo, the basic structure of which is:
The tsconfig files in each of the packages extends the root tsconfig. doczrc.js looks like: /* packages/docz/doczrc.js */
export default {
typescript: true,
files: ["./**/*.mdx", "../components/**/*.mdx"],
}; A ClueI've found that if i move the the tsx files to be in A solution?Some poking around in docz-core lead me to try this config change: /* packages/docz/doczrc.js */
export default {
typescript: true,
files: ["./**/*.mdx", "../components/**/*.mdx"],
docgenConfig: {
searchPatterns: [
"../**/*.{ts,tsx,js,jsx,mjs}",
"!**/node_modules",
"!**/doczrc.js",
],
},
}; And, after clearing docz cache, it worked! It seems that the |
Important in Monorepo structures like above: docz and docgen will look for a tsconfig file in the docz root, not in the components package! to initialize an default tsconfig you can execute this from your docz package:
|
What about allowing setting the tsconfig path from the config file? The |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bug Report
Describe the bug
The props table (
Props
component) isn't displaying anything when using typescriptTo Reproduce
Please try to build a small repo with a repro of your problem and provide a link to it.
Doing that allows more people to quickly help you.
If you can't provide a repo then provide clear steps describing how to reproduce the issue.
Alert.jsx
toAlert.tsx
doczrc.js
file to the root with the following contentExpected behavior
I expect the props table to be filled with the props defined.
Environment
Screenshot
The text was updated successfully, but these errors were encountered: