Comments (1)
It's really coming from typescript as it is exactly what you get inside Text
component from intellisense for this.children
.
The reason why you get this is the type definition for React.Component<>
which includes the following
// React.Props<T> is now deprecated, which means that the `children`
// property is not available on `P` by default, even though you can
// always pass children as variadic arguments to `createElement`.
// In the future, if we can define its call signature conditionally
// on the existence of `children` in `P`, then we should remove this.
props: Readonly<{ children?: ReactNode }> & Readonly<P>;
If I read that comment correctly, maybe one day that will be fixed there and everything will be fine.
Unfortunately, I am not seeing any simple/easy trick how to "fix" that. I also think that it could bring more problems as well.
Maybe one solution that you could use is creating a simple wrapper around the parse method. In that wrapper just iterate over all components and their properties and for children with specific type return string instead.
from react-docgen-typescript.
Related Issues (20)
- Explicit types ignored in favor of underlying, implicit types HOT 2
- Not able to access /node_modules/.cache/ts-docgen HOT 2
- Move to async functions HOT 2
- Args of Table doesn't show content HOT 2
- is any annotations can support hidden property's api doc in output HOT 3
- Styled Components v6 are not parsed correctly HOT 1
- Docs not generated for memo<Props>() syntax HOT 3
- How to manually set default value for a props? HOT 3
- Ignore props & method extended to HTMLMotionProps<'div'> from framer-motion HOT 2
- Can you support projects built with vite? HOT 3
- Bug after update to typescript 5.0.2 HOT 4
- A union type that also contains ` | string` loses the rest of the union and is displayed as just string. HOT 1
- Component's props are not parsed in the file where a component and function(util) exist together. HOT 2
- Tree-shaking on a package (monorepo) breaks docgen. HOT 4
- [Error] adding jsdoc @author tag throwing error `array.map is not a function`
- [Bug]: declarations and parent objects for props are not populated with TypeScript >= v5.1.3 HOT 1
- Incorrect Display of Custom Type Attributes in Documentation HOT 5
- What is the future of this project? HOT 4
- `export default function` declaration doesn't work HOT 1
- @defaultValue is not parsed from interface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-docgen-typescript.