-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow custom container component and more customization
By default, Autolink will continue to behave as before: output will be wrapped in a single Text node and non-Autolink props will be passed through to that node. To allow for more customization, you can now specify a custom component, for example View, to use as the container instead of Text using the `component` prop. Any non-Autolink props will be passed through to this component instead, and all text within is wrapped with Text components as required by RN. Additionally, the new `linkProps` and `textProps` props allow you to pass any props to links or text components, respectively. And the new `renderText` prop allows you to completely customize how text is wrapped in the output. BREAKING CHANGE: Non-Autolink props are no longer passed to links. Only styles supplied to `linkStyle` and props supplied to `linkProps` are used when rendering links. You are still free to use `renderLink` to fully customize link rendering. closes #48
- Loading branch information
Showing
4 changed files
with
113 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type PropsOf< | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
E extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any> | ||
> = JSX.LibraryManagedAttributes<E, React.ComponentPropsWithRef<E>>; |