-
Notifications
You must be signed in to change notification settings - Fork 186
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
linkify-element
4.0.0-beta.3 missing type for Options
#376
Comments
One possible fix would be to use something like:
|
I tried this locally, and this works for me: diff --git a/packages/linkify-react/src/linkify-react.js b/packages/linkify-react/src/linkify-react.js
index 86af2ca..dba32cd 100644
--- a/packages/linkify-react/src/linkify-react.js
+++ b/packages/linkify-react/src/linkify-react.js
@@ -77,10 +77,14 @@ function linkifyReactElement(element, opts, elementId = 0) {
return React.cloneElement(element, newProps, children);
}
+/**
+ * @typedef { import("linkifyjs").Options } Options
+ */
+
/**
* @template P
* @template {string | React.JSXElementConstructor<P>} T
- * @param {P & { as?: T, tagName?: T, tagName?: T, options?: any, children?: React.ReactNode}} props
+ * @param {P & { as?: T, tagName?: T, tagName?: T, options?: Options, children?: React.ReactNode}} props
* @returns {React.ReactElement<P, T>}
*/
const Linkify = (props) => { |
Well, "works" might be an overstatement, now that I try to actually use it. I think this might make tsc hang. |
Merged
Thanks for the quick fix! I can confirm the types are now working well for me with 4.0.0-beta.4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using
linkify-element
4.0.0-beta.3, it seems the bundled type definitions in the package don't provide a type for theOptions
arg oflinkifyElementHelper
:The text was updated successfully, but these errors were encountered: