import { jsx, jsxs, Fragment } from 'solid-jsx/jsx-runtime';

/*@jsxRuntime automatic @jsxImportSource solid-jsx*/
const toc = [];
function _createMdxContent(props) {
  const _components = Object.assign({
    p: "p",
    code: "code",
    pre: "pre",
    span: "span"
  }, props.components);
  return jsxs(Fragment, {
    children: [jsxs(_components.p, {
      children: ["Тег ", " полезен когда нам нужно определить вид компонента для рендера с помощью данных. Он позволяет передавать либо строку для нативного элемента, либо функцию компонента, и он будет рендерить её вместе с предоставленными (", jsx(_components.code, {
        children: "props"
      }), ")."]
    }), "\n", jsxs(_components.p, {
      children: ["Часто при использовании ", jsx(_components.code, {
        children: "Dynamic"
      }), " компонента ваша запись будет более компактной, чем если бы вы использовали ", jsx(_components.code, {
        children: "<Show>"
      }), " или ", jsx(_components.code, {
        children: "<Switch>"
      }), "."]
    }), "\n", jsxs(_components.p, {
      children: ["В этом примере мы можем заменить ", jsx(_components.code, {
        children: "<Switch>"
      }), ":"]
    }), "\n", jsx(_components.pre, {
      children: jsxs(_components.code, {
        className: "hljs language-jsx",
        children: ["<", jsx(_components.span, {
          className: "hljs-title class_",
          children: "Switch"
        }), " fallback={", jsx(_components.span, {
          className: "xml",
          children: jsxs(_components.span, {
            className: "hljs-tag",
            children: ["<", jsx(_components.span, {
              className: "hljs-name",
              children: "BlueThing"
            }), " />"]
          })
        }), "}>\n  ", jsxs(_components.span, {
          className: "xml",
          children: [jsxs(_components.span, {
            className: "hljs-tag",
            children: ["<", jsx(_components.span, {
              className: "hljs-name",
              children: "Match"
            }), " ", jsx(_components.span, {
              className: "hljs-attr",
              children: "when"
            }), "=", jsx(_components.span, {
              className: "hljs-string",
              children: "{selected()"
            }), " === ", jsx(_components.span, {
              className: "hljs-string",
              children: "'red'"
            }), "}>"]
          }), jsxs(_components.span, {
            className: "hljs-tag",
            children: ["<", jsx(_components.span, {
              className: "hljs-name",
              children: "RedThing"
            }), " />"]
          }), jsxs(_components.span, {
            className: "hljs-tag",
            children: ["</", jsx(_components.span, {
              className: "hljs-name",
              children: "Match"
            }), ">"]
          })]
        }), "\n  ", jsxs(_components.span, {
          className: "xml",
          children: [jsxs(_components.span, {
            className: "hljs-tag",
            children: ["<", jsx(_components.span, {
              className: "hljs-name",
              children: "Match"
            }), " ", jsx(_components.span, {
              className: "hljs-attr",
              children: "when"
            }), "=", jsx(_components.span, {
              className: "hljs-string",
              children: "{selected()"
            }), " === ", jsx(_components.span, {
              className: "hljs-string",
              children: "'green'"
            }), "}>"]
          }), jsxs(_components.span, {
            className: "hljs-tag",
            children: ["<", jsx(_components.span, {
              className: "hljs-name",
              children: "GreenThing"
            }), " />"]
          }), jsxs(_components.span, {
            className: "hljs-tag",
            children: ["</", jsx(_components.span, {
              className: "hljs-name",
              children: "Match"
            }), ">"]
          })]
        }), "\n</", jsx(_components.span, {
          className: "hljs-title class_",
          children: "Switch"
        }), ">\n"]
      })
    }), "\n", jsx(_components.p, {
      children: "на:"
    }), "\n", jsx(_components.pre, {
      children: jsxs(_components.code, {
        className: "hljs language-jsx",
        children: ["<", jsx(_components.span, {
          className: "hljs-title class_",
          children: "Dynamic"
        }), " component={options[", jsx(_components.span, {
          className: "hljs-title function_",
          children: "selected"
        }), "()]} />\n"]
      })
    })]
  });
}
function MDXContent(props = {}) {
  const {wrapper: MDXLayout} = props.components || ({});
  return MDXLayout ? jsx(MDXLayout, Object.assign({}, props, {
    children: jsx(_createMdxContent, props)
  })) : _createMdxContent(props);
}

export { MDXContent as default, toc };
//# sourceMappingURL=lesson-11f3dccc.js.map
