/*! For license information please see 9d74b173.f51423e0.js.LICENSE.txt */
"use strict";(self.webpackChunkweb_totals=self.webpackChunkweb_totals||[]).push([[5431],{91652:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>m});var s=n(85893),a=n(11151);const o={sidebar_position:1,title:"Context API",comment:!0,tags:["Reactjs","State management","Context API"]},r=void 0,c={id:"reactjs/state-management/context",title:"Context API",description:"Demo",source:"@site/issues/reactjs/state-management/context.mdx",sourceDirName:"reactjs/state-management",slug:"/reactjs/state-management/context",permalink:"/issues/reactjs/state-management/context",draft:!1,unlisted:!1,editUrl:"https://github.com/hunghg255/web-totals/tree/main/issues/reactjs/state-management/context.mdx",tags:[{label:"Reactjs",permalink:"/issues/tags/reactjs"},{label:"State management",permalink:"/issues/tags/state-management"},{label:"Context API",permalink:"/issues/tags/context-api"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,title:"Context API",comment:!0,tags:["Reactjs","State management","Context API"]},sidebar:"tutorialSidebar",previous:{title:"useFadeEffect",permalink:"/issues/reactjs/custom-hook/useFadeEffect"},next:{title:"Context API Faster",permalink:"/issues/reactjs/state-management/context-fast"}},i={},m=[{value:"Demo",id:"demo",level:2}];function l(e){const t={a:"a",h2:"h2",p:"p",...(0,a.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"demo",children:"Demo"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://react.dev/reference/react/useContext",children:"Context"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://github.com/hunghg255/reactjs-state-management/tree/master/simple-context",children:"Source"})}),"\n",(0,s.jsx)("video",{src:"https://res.cloudinary.com/hunghg255/video/upload/v1679539195/blog/context_nu7hgh.mov",loop:!0,muted:!0,controls:!0,autoplay:!0})]})}function u(e={}){const{wrapper:t}={...(0,a.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},75251:(e,t,n)=>{var s=n(67294),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function m(e,t,n){var s,o={},m=null,l=null;for(s in void 0!==n&&(m=""+n),void 0!==t.key&&(m=""+t.key),void 0!==t.ref&&(l=t.ref),t)r.call(t,s)&&!i.hasOwnProperty(s)&&(o[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===o[s]&&(o[s]=t[s]);return{$$typeof:a,type:e,key:m,ref:l,props:o,_owner:c.current}}t.Fragment=o,t.jsx=m,t.jsxs=m},85893:(e,t,n)=>{e.exports=n(75251)},11151:(e,t,n)=>{n.d(t,{Z:()=>c,a:()=>r});var s=n(67294);const a={},o=s.createContext(a);function r(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]);