-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
WIP: feat: add better handing for typescript complier #2088
base: dev
Are you sure you want to change the base?
WIP: feat: add better handing for typescript complier #2088
Conversation
fix: soft file there is no props defined Check if export is either a class or function that returns JSX element This allows for none exported JSX functions in the file. Signed-off-by: Jordan Hall <jordan@libertyware.co.uk>
@T4rk1n before i carry on and add Unit test for these. This is what I was thinking to solve #2066 (comment). The error comes from not checking the type is related to JSX before trying to work out the props.
would cause the complier to break. So while i was at it, i thought its best to check the return type is an element. If this is ok, I'll take a look at how to add support for multiple components in a single file. Currently you always override the docs each time which isn't ideal |
The failed unit test relates to JSX just returning null. In real world I can't ever expect it not to be Element. But happy to remove that extra check for JSX |
Seems ok, just make sure that |
fix: soft file there is no props defined
Check if export is either a class or function that returns JSX element
This allows for none exported JSX functions in the file.
For example if you had the following file:
The export default would crash and file due to not having props. Now it will check its a function or a class before trying to convert to dash py