text: (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{bmK4:function(e,n,a){"use strict";a.r(n),a.d(n,"_frontmatter",(function(){return b})),a.d(n,"default",(function(){return i}));a("5hJT"),a("W1QL"),a("K/PF"),a("t91x"),a("75LO"),a("PJhk"),a("mXGw");var t=a("/FXl"),o=a("TjRS"),r=a("ZFoC"),c=a("ZQZR");a("aD51");function l(){return(l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e}).apply(this,arguments)}var b={};void 0!==b&&b&&b===Object(b)&&Object.isExtensible(b)&&!b.hasOwnProperty("__filemeta")&&Object.defineProperty(b,"__filemeta",{configurable:!0,value:{name:"_frontmatter",filename:"docz/hoc-fallback.mdx"}});var p={_frontmatter:b},s=o.a;function i(e){var n=e.components,a=function(e,n){if(null==e)return{};var a,t,o={},r=Object.keys(e);for(t=0;t<r.length;t++)a=r[t],n.indexOf(a)>=0||(o[a]=e[a]);return o}(e,["components"]);return Object(t.b)(s,l({},p,a,{components:n,mdxType:"MDXLayout"}),Object(t.b)(c.h,{heading:!0,page:"fallbackHoc",num:"0",mdxType:"Translator"}),Object(t.b)(c.h,{page:"fallbackHoc",num:"0",mdxType:"Translator"}),Object(t.b)(c.h,{page:"fallbackHoc",num:"1",mdxType:"Translator"}),Object(t.b)(c.h,{page:"fallbackHoc",num:"2",mdxType:"Translator"}),Object(t.b)("pre",null,Object(t.b)("code",l({parentName:"pre"},{className:"language-jsx"}),'// ./i18n/index.js\nconst data = {\n  de: {\n    text: "Hallo Welt!",\n  },\n  en: {\n    text: "Hello World!",\n  },\n  es: {\n    text: "!Hola Mundo!",\n  },\n};\n\nexport { data };\n')),Object(t.b)(c.h,{page:"fallbackHoc",num:"3",mdxType:"Translator"}),Object(t.b)(c.h,{page:"fallbackHoc",num:"4",mdxType:"Translator"}),Object(t.b)("pre",null,Object(t.b)("code",l({parentName:"pre"},{className:"language-jsx"}),'import React from "react";\nimport { withI18n } from "react-i18n-kit";\n\nimport { data } from "./i18n";\n\nconst Text = props => <div>{props.i18n.text}</div>;\n\n/*\n  Never set a language you do not have a translation for.\n  We just use it as example, so you can see the fallback in your browser.\n*/\nconst TextI18n = withI18n(Text, data, {\n  lang: "zh",\n  fallback: "es",\n});\n\nexport { TextI18n as Text };\n')),Object(t.b)(c.h,{page:"fallbackHoc",num:"5",mdxType:"Translator"}),Object(t.b)(r.c,{__position:7,__code:"<Text />",__scope:{props:a,DefaultLayout:o.a,Playground:r.c,Translator:c.h,Text:c.c},mdxType:"Playground"},Object(t.b)(c.c,{mdxType:"Text"})),Object(t.b)(c.h,{page:"fallbackHoc",num:"6",mdxType:"Translator"}),Object(t.b)(r.c,{__position:9,__code:'<Text lang="zh" fallback="de" />',__scope:{props:a,DefaultLayout:o.a,Playground:r.c,Translator:c.h,Text:c.c},mdxType:"Playground"},Object(t.b)(c.c,{lang:"zh",fallback:"de",mdxType:"Text"})))}i&&i===Object(i)&&Object.isExtensible(i)&&!i.hasOwnProperty("__filemeta")&&Object.defineProperty(i,"__filemeta",{configurable:!0,value:{name:"MDXContent",filename:"docz/hoc-fallback.mdx"}}),i.isMDXComponent=!0}}]);
  //# sourceMappingURL=component---docz-hoc-fallback-mdx-244a58b0fd5a42c95fe4.js.map