Skip to content

Commit 2e22cb3

Browse files
committed
docs: remove warning about polymorphic components in configurations docs
1 parent ff5ab9d commit 2e22cb3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

website/pages/docs/configurations.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ If `importSource` is specified, an equivalent version of React should be provide
4040

4141
(type: `string`)
4242

43-
<Callout type="warning">Polymorphic components can make code harder to maintain; please use this feature with caution.</Callout>
44-
4543
You can optionally use the `polymorphicPropName` setting to define the prop your code uses to create polymorphic components. This setting will be used determine the element type in rules that require semantic context.
4644

4745
For example, if you set the `polymorphicPropName` setting to `as` then this element:
@@ -64,15 +62,15 @@ A object of aliases for React built-in hooks. ESLint React will recognize these
6462

6563
(type: `{ name: string; as: string; attributes: { name: string; as?: string; defaultValue?: string }[] }[]`)
6664

67-
<Callout type="info">If `polymorphicPropName` meets the requirements, always consider using it instead of this setting, as it is simpler and more efficient.</Callout>
65+
<Callout type="info">Before using `additionalComponents`, consider whether `polymorphicPropName` can be used instead, as it simpler and more efficient.</Callout>
6866

6967
<Callout type="warning">This is an experimental feature that can be unstable and lacks documentation.</Callout>
7068

7169
An array of components and its attributes mapping. It allows the related rules to do even more comprehensive analysis on them than just using the `polymorphicPropName` setting. You can also provide default values for attributes here, that will be used when that attribute is not present in the component.
7270

73-
(e.g. The `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }] }]` demystifies a `<Link to="https://eslint-react.xyz" />` as an `<a href="https://eslint-react.xyz" />` so that the `dom/no-unsafe-target-blank` rule can perform checks on it)
71+
(e.g. The `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }] }]` demystifies a `<Link to="https://eslint-react.xyz" />` as an `<a href="https://eslint-react.xyz" />`, so that the `dom/no-unsafe-target-blank` rule can perform checks on it)
7472

75-
(e.g. The `[{ name: "EmbedContent", as: "iframe", attributes: [{ name: "sandbox", defaultValue: "" }] }]` demystifies an `<EmbedContent src="https://eslint-react.xyz" />` as an `<iframe src="https://eslint-react.xyz" sandbox="" />` so that both the `dom/no-missing-sandbox` and `dom/no-unsafe-sandbox` rules can perform checks on it)
73+
(e.g. The `[{ name: "EmbedContent", as: "iframe", attributes: [{ name: "sandbox", defaultValue: "" }] }]` demystifies an `<EmbedContent src="https://eslint-react.xyz" />` as an `<iframe src="https://eslint-react.xyz" sandbox="" />`, so that both the `dom/no-missing-sandbox` and `dom/no-unsafe-sandbox` rules can perform checks on it)
7674

7775
## Examples
7876

0 commit comments

Comments
 (0)