-
Notifications
You must be signed in to change notification settings - Fork 83
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
Error TS2305: Module '"react-element-to-jsx-string"' has no exported member 'Options' #514
Comments
Hi @leonelgalan, When you said that In v14.2, we recently added the I think there was an issue with the line:
We never export the type That said, we should probably export in flow and TS the options type. |
The build fails with the error above:
My wild guess is that flow exported it implicitly, because it was part of the signature of the default function exported. For TS, this seems to work: diff --git a/index.d.ts b/index.d.ts
index c2bc46a..83ff4c6 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -13,7 +13,8 @@ declare module 'react-element-to-jsx-string' {
sortProps?: boolean;
useFragmentShortSyntax?: boolean;
}
+ export { ReactElementToJSXStringOptions as Options };
const reactElementToJSXString: (element: ReactNode, options?: ReactElementToJSXStringOptions) => string;
- export = reactElementToJSXString;
+ export default reactElementToJSXString;
} I was able to use the new filterProps by linking ( |
The PR #516 should fix this |
I just publish |
storybookjs/addon-jsx fails when updating from
14.1.0
to14.3.0
with the error above, because the following line:I'm not familiar with publishing types, but I believe the error is because related to index.d.ts not exporting
ReactElementToJSXStringOptions
, perhaps asOptions
?The text was updated successfully, but these errors were encountered: