mobx-react
Advanced tools
Comparing version 7.0.4 to 7.0.5
# mobx-react | ||
## 7.0.5 | ||
### Patch Changes | ||
- [`2f3dcb27`](https://github.com/mobxjs/mobx/commit/2f3dcb274f795ffca4ae724b6b4795958620838d) Thanks [@FredyC](https://github.com/FredyC)! - Fix names of UMD exports [#2517](https://github.com/mobxjs/mobx/issues/2617) | ||
- Updated dependencies [[`2f3dcb27`](https://github.com/mobxjs/mobx/commit/2f3dcb274f795ffca4ae724b6b4795958620838d), [`79a09f49`](https://github.com/mobxjs/mobx/commit/79a09f49a9f2baddbab8d89e9a7ac07cffadf624)]: | ||
- mobx-react-lite@3.1.6 | ||
- mobx@6.0.4 | ||
## 7.0.4 | ||
@@ -4,0 +14,0 @@ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx'), require('react'), require('mobx-react-lite')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'mobx', 'react', 'mobx-react-lite'], factory) : | ||
(global = global || self, factory(global.mobxreact = {}, global.mobx, global.React, global.mobxReactLite)); | ||
(global = global || self, factory(global.mobxReact = {}, global.mobx, global.React, global.mobxReactLite)); | ||
}(this, (function (exports, mobx, React, mobxReactLite) { 'use strict'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("mobx"),require("react"),require("mobx-react-lite")):"function"==typeof define&&define.amd?define(["exports","mobx","react","mobx-react-lite"],r):r((e=e||self).mobxreact={},e.mobx,e.React,e.mobxReactLite)}(this,(function(e,r,t,n){"use strict";var o="default"in t?t.default:t,a=0,i={};function c(e){return i[e]||(i[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var r="__$mobx-react "+e+" ("+a+")";return a++,r}(e)),i[e]}function s(e,r){if(u(e,r))return!0;if("object"!=typeof e||null===e||"object"!=typeof r||null===r)return!1;var t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(!Object.hasOwnProperty.call(r,t[o])||!u(e[t[o]],r[t[o]]))return!1;return!0}function u(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}var f={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,propTypes:1};function l(e,r,t){Object.hasOwnProperty.call(e,r)?e[r]=t:Object.defineProperty(e,r,{enumerable:!1,configurable:!0,writable:!0,value:t})}var p=c("patchMixins"),b=c("patchedDefinition");function d(e,r){for(var t=this,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];r.locks++;try{var i;return null!=e&&(i=e.apply(this,o)),i}finally{r.locks--,0===r.locks&&r.methods.forEach((function(e){e.apply(t,o)}))}}function y(e,r){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];d.call.apply(d,[this,e,r].concat(n))}}function m(e,r,t){var n=function(e,r){var t=e[p]=e[p]||{},n=t[r]=t[r]||{};return n.locks=n.locks||0,n.methods=n.methods||[],n}(e,r);n.methods.indexOf(t)<0&&n.methods.push(t);var o=Object.getOwnPropertyDescriptor(e,r);if(!o||!o[b]){var a=function e(r,t,n,o,a){var i,c=y(a,o);return(i={})[b]=!0,i.get=function(){return c},i.set=function(a){if(this===r)c=y(a,o);else{var i=e(this,t,n,o,a);Object.defineProperty(this,t,i)}},i.configurable=!0,i.enumerable=n,i}(e,r,o?o.enumerable:void 0,n,e[r]);Object.defineProperty(e,r,a)}}var v=r.$mobx||"$mobx",h=c("isMobXReactObserver"),O=c("isUnmounted"),g=c("skipRender"),w=c("isForcingUpdate");function j(e){var r=e.prototype;if(e[h]){var o=P(r);console.warn("The provided component class ("+o+") \n has already been declared as an observer component.")}else e[h]=!0;if(r.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==t.PureComponent)if(r.shouldComponentUpdate){if(r.shouldComponentUpdate!==R)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else r.shouldComponentUpdate=R;S(r,"props"),S(r,"state");var a=r.render;return r.render=function(){return x.call(this,a)},m(r,"componentWillUnmount",(function(){var e;if(!0!==n.isUsingStaticRendering()&&(null==(e=this.render[v])||e.dispose(),this[O]=!0,!this.render[v])){var r=P(this);console.warn("The reactive render of an observer class component ("+r+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}})),e}function P(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function x(e){var o=this;if(!0===n.isUsingStaticRendering())return e.call(this);l(this,g,!1),l(this,w,!1);var a=P(this),i=e.bind(this),c=!1,s=new r.Reaction(a+".render()",(function(){if(!c&&(c=!0,!0!==o[O])){var e=!0;try{l(o,w,!0),o[g]||t.Component.prototype.forceUpdate.call(o),e=!1}finally{l(o,w,!1),e&&s.dispose()}}}));function u(){c=!1;var e=void 0,t=void 0;if(s.track((function(){try{t=r._allowStateChanges(!1,i)}catch(r){e=r}})),e)throw e;return t}return s.reactComponent=this,u[v]=s,this.render=u,u.call(this)}function R(e,r){return n.isUsingStaticRendering()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==r||!s(this.props,e)}function S(e,t){var n=c("reactProp_"+t+"_valueHolder"),o=c("reactProp_"+t+"_atomHolder");function a(){return this[o]||l(this,o,r.createAtom("reactive "+t)),this[o]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(e=r._allowStateReadsStart(!0)),a.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&r._allowStateReadsEnd(e),this[n]},set:function(e){this[w]||s(this[n],e)?l(this,n,e):(l(this,n,e),l(this,g,!0),a.call(this).reportChanged(),l(this,g,!1))}})}var C="function"==typeof Symbol&&Symbol.for,E=C?Symbol.for("react.forward_ref"):"function"==typeof t.forwardRef&&t.forwardRef((function(e){return null})).$$typeof,A=C?Symbol.for("react.memo"):"function"==typeof t.memo&&t.memo((function(e){return null})).$$typeof;function k(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),A&&e.$$typeof===A)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(E&&e.$$typeof===E){var r=e.render;if("function"!=typeof r)throw new Error("render property of ForwardRef was not a function");return t.forwardRef((function(){var e=arguments;return t.createElement(n.Observer,null,(function(){return r.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(t.Component,e)?j(e):n.observer(e)}function U(){return(U=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var _=o.createContext({});function M(e){var r=e.children,t=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}(e,["children"]),n=o.useContext(_),a=o.useRef(U({},n,t));return o.createElement(_.Provider,{value:a.current},r)}function T(e,r,t,n){var a,i,c,s=o.forwardRef((function(t,n){var a=U({},t),i=o.useContext(_);return Object.assign(a,e(i||{},a)||{}),n&&(a.ref=n),o.createElement(r,a)}));return n&&(s=k(s)),s.isMobxInjector=!0,a=r,i=s,c=Object.getOwnPropertyNames(Object.getPrototypeOf(a)),Object.getOwnPropertyNames(a).forEach((function(e){f[e]||-1!==c.indexOf(e)||Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))})),s.wrappedComponent=r,s.displayName=function(e,r){var t=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r?"inject-with-"+r+"("+t+")":"inject("+t+")"}(r,t),s}function $(e){return function(r,t){return e.forEach((function(e){if(!(e in t)){if(!(e in r))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");t[e]=r[e]}})),t}}M.displayName="MobXProvider";var q=c("disposeOnUnmountProto"),D=c("disposeOnUnmountInst");function L(){var e=this;[].concat(this[q]||[],this[D]||[]).forEach((function(r){var t="string"==typeof r?e[r]:r;null!=t&&(Array.isArray(t)?t.map((function(e){return e()})):t())}))}function N(e){function t(t,n,o,a,i,c){for(var s=arguments.length,u=new Array(s>6?s-6:0),f=6;f<s;f++)u[f-6]=arguments[f];return r.untracked((function(){return a=a||"<<anonymous>>",c=c||o,null==n[o]?t?new Error("The "+i+" `"+c+"` is marked as required in `"+a+"`, but its value is `"+(null===n[o]?"null":"undefined")+"`."):null:e.apply(void 0,[n,o,a,i,c].concat(u))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function I(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||"Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol}(r,e)?"symbol":r}function X(e,t){return N((function(n,o,a,i,c){return r.untracked((function(){if(e&&I(n[o])===t.toLowerCase())return null;var i;switch(t){case"Array":i=r.isObservableArray;break;case"Object":i=r.isObservableObject;break;case"Map":i=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var s=n[o];if(!i(s)){var u=function(e){var r=I(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}(s),f=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+c+"` of type `"+u+"` supplied to `"+a+"`, expected `mobx.Observable"+t+"`"+f+".")}return null}))}))}function F(e,t){return N((function(n,o,a,i,c){for(var s=arguments.length,u=new Array(s>5?s-5:0),f=5;f<s;f++)u[f-5]=arguments[f];return r.untracked((function(){if("function"!=typeof t)return new Error("Property `"+c+"` of component `"+a+"` has invalid PropType notation.");var r=X(e,"Array")(n,o,a,i,c);if(r instanceof Error)return r;for(var s=n[o],f=0;f<s.length;f++)if((r=t.apply(void 0,[s,f,a,i,c+"["+f+"]"].concat(u)))instanceof Error)return r;return null}))}))}var W={observableArray:X(!1,"Array"),observableArrayOf:F.bind(null,!1),observableMap:X(!1,"Map"),observableObject:X(!1,"Object"),arrayOrObservableArray:X(!0,"Array"),arrayOrObservableArrayOf:F.bind(null,!0),objectOrObservableObject:X(!0,"Object")};if(!t.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available");Object.defineProperty(e,"Observer",{enumerable:!0,get:function(){return n.Observer}}),Object.defineProperty(e,"enableStaticRendering",{enumerable:!0,get:function(){return n.enableStaticRendering}}),Object.defineProperty(e,"isUsingStaticRendering",{enumerable:!0,get:function(){return n.isUsingStaticRendering}}),Object.defineProperty(e,"observerBatching",{enumerable:!0,get:function(){return n.observerBatching}}),Object.defineProperty(e,"useAsObservableSource",{enumerable:!0,get:function(){return n.useAsObservableSource}}),Object.defineProperty(e,"useLocalObservable",{enumerable:!0,get:function(){return n.useLocalObservable}}),Object.defineProperty(e,"useLocalStore",{enumerable:!0,get:function(){return n.useLocalStore}}),Object.defineProperty(e,"useObserver",{enumerable:!0,get:function(){return n.useObserver}}),Object.defineProperty(e,"useStaticRendering",{enumerable:!0,get:function(){return n.useStaticRendering}}),e.MobXProviderContext=_,e.PropTypes=W,e.Provider=M,e.disposeOnUnmount=function e(r,t){if(Array.isArray(t))return t.map((function(t){return e(r,t)}));var n=Object.getPrototypeOf(r).constructor,a=Object.getPrototypeOf(r.constructor),i=Object.getPrototypeOf(Object.getPrototypeOf(r));if(n!==o.Component&&n!==o.PureComponent&&a!==o.Component&&a!==o.PureComponent&&i!==o.Component&&i!==o.PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof t&&"function"!=typeof t&&!Array.isArray(t))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var c=!!r[q]||!!r[D];return("string"==typeof t?r[q]||(r[q]=[]):r[D]||(r[D]=[])).push(t),c||m(r,"componentWillUnmount",L),"string"!=typeof t?t:void 0},e.inject=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if("function"==typeof arguments[0]){var n=arguments[0];return function(e){return T(n,e,n.name,!0)}}return function(e){return T($(r),e,r.join("-"),!1)}},e.observer=k,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("mobx"),require("react"),require("mobx-react-lite")):"function"==typeof define&&define.amd?define(["exports","mobx","react","mobx-react-lite"],r):r((e=e||self).mobxReact={},e.mobx,e.React,e.mobxReactLite)}(this,(function(e,r,t,n){"use strict";var o="default"in t?t.default:t,a=0,i={};function c(e){return i[e]||(i[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var r="__$mobx-react "+e+" ("+a+")";return a++,r}(e)),i[e]}function s(e,r){if(u(e,r))return!0;if("object"!=typeof e||null===e||"object"!=typeof r||null===r)return!1;var t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(!Object.hasOwnProperty.call(r,t[o])||!u(e[t[o]],r[t[o]]))return!1;return!0}function u(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}var f={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,propTypes:1};function l(e,r,t){Object.hasOwnProperty.call(e,r)?e[r]=t:Object.defineProperty(e,r,{enumerable:!1,configurable:!0,writable:!0,value:t})}var p=c("patchMixins"),b=c("patchedDefinition");function d(e,r){for(var t=this,n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];r.locks++;try{var i;return null!=e&&(i=e.apply(this,o)),i}finally{r.locks--,0===r.locks&&r.methods.forEach((function(e){e.apply(t,o)}))}}function y(e,r){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];d.call.apply(d,[this,e,r].concat(n))}}function m(e,r,t){var n=function(e,r){var t=e[p]=e[p]||{},n=t[r]=t[r]||{};return n.locks=n.locks||0,n.methods=n.methods||[],n}(e,r);n.methods.indexOf(t)<0&&n.methods.push(t);var o=Object.getOwnPropertyDescriptor(e,r);if(!o||!o[b]){var a=function e(r,t,n,o,a){var i,c=y(a,o);return(i={})[b]=!0,i.get=function(){return c},i.set=function(a){if(this===r)c=y(a,o);else{var i=e(this,t,n,o,a);Object.defineProperty(this,t,i)}},i.configurable=!0,i.enumerable=n,i}(e,r,o?o.enumerable:void 0,n,e[r]);Object.defineProperty(e,r,a)}}var v=r.$mobx||"$mobx",h=c("isMobXReactObserver"),O=c("isUnmounted"),g=c("skipRender"),w=c("isForcingUpdate");function j(e){var r=e.prototype;if(e[h]){var o=P(r);console.warn("The provided component class ("+o+") \n has already been declared as an observer component.")}else e[h]=!0;if(r.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==t.PureComponent)if(r.shouldComponentUpdate){if(r.shouldComponentUpdate!==R)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else r.shouldComponentUpdate=R;S(r,"props"),S(r,"state");var a=r.render;return r.render=function(){return x.call(this,a)},m(r,"componentWillUnmount",(function(){var e;if(!0!==n.isUsingStaticRendering()&&(null==(e=this.render[v])||e.dispose(),this[O]=!0,!this.render[v])){var r=P(this);console.warn("The reactive render of an observer class component ("+r+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}})),e}function P(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function x(e){var o=this;if(!0===n.isUsingStaticRendering())return e.call(this);l(this,g,!1),l(this,w,!1);var a=P(this),i=e.bind(this),c=!1,s=new r.Reaction(a+".render()",(function(){if(!c&&(c=!0,!0!==o[O])){var e=!0;try{l(o,w,!0),o[g]||t.Component.prototype.forceUpdate.call(o),e=!1}finally{l(o,w,!1),e&&s.dispose()}}}));function u(){c=!1;var e=void 0,t=void 0;if(s.track((function(){try{t=r._allowStateChanges(!1,i)}catch(r){e=r}})),e)throw e;return t}return s.reactComponent=this,u[v]=s,this.render=u,u.call(this)}function R(e,r){return n.isUsingStaticRendering()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==r||!s(this.props,e)}function S(e,t){var n=c("reactProp_"+t+"_valueHolder"),o=c("reactProp_"+t+"_atomHolder");function a(){return this[o]||l(this,o,r.createAtom("reactive "+t)),this[o]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(e=r._allowStateReadsStart(!0)),a.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&r._allowStateReadsEnd(e),this[n]},set:function(e){this[w]||s(this[n],e)?l(this,n,e):(l(this,n,e),l(this,g,!0),a.call(this).reportChanged(),l(this,g,!1))}})}var C="function"==typeof Symbol&&Symbol.for,E=C?Symbol.for("react.forward_ref"):"function"==typeof t.forwardRef&&t.forwardRef((function(e){return null})).$$typeof,A=C?Symbol.for("react.memo"):"function"==typeof t.memo&&t.memo((function(e){return null})).$$typeof;function k(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),A&&e.$$typeof===A)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(E&&e.$$typeof===E){var r=e.render;if("function"!=typeof r)throw new Error("render property of ForwardRef was not a function");return t.forwardRef((function(){var e=arguments;return t.createElement(n.Observer,null,(function(){return r.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(t.Component,e)?j(e):n.observer(e)}function U(){return(U=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var _=o.createContext({});function M(e){var r=e.children,t=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}(e,["children"]),n=o.useContext(_),a=o.useRef(U({},n,t));return o.createElement(_.Provider,{value:a.current},r)}function T(e,r,t,n){var a,i,c,s=o.forwardRef((function(t,n){var a=U({},t),i=o.useContext(_);return Object.assign(a,e(i||{},a)||{}),n&&(a.ref=n),o.createElement(r,a)}));return n&&(s=k(s)),s.isMobxInjector=!0,a=r,i=s,c=Object.getOwnPropertyNames(Object.getPrototypeOf(a)),Object.getOwnPropertyNames(a).forEach((function(e){f[e]||-1!==c.indexOf(e)||Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))})),s.wrappedComponent=r,s.displayName=function(e,r){var t=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r?"inject-with-"+r+"("+t+")":"inject("+t+")"}(r,t),s}function $(e){return function(r,t){return e.forEach((function(e){if(!(e in t)){if(!(e in r))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");t[e]=r[e]}})),t}}M.displayName="MobXProvider";var q=c("disposeOnUnmountProto"),D=c("disposeOnUnmountInst");function L(){var e=this;[].concat(this[q]||[],this[D]||[]).forEach((function(r){var t="string"==typeof r?e[r]:r;null!=t&&(Array.isArray(t)?t.map((function(e){return e()})):t())}))}function N(e){function t(t,n,o,a,i,c){for(var s=arguments.length,u=new Array(s>6?s-6:0),f=6;f<s;f++)u[f-6]=arguments[f];return r.untracked((function(){return a=a||"<<anonymous>>",c=c||o,null==n[o]?t?new Error("The "+i+" `"+c+"` is marked as required in `"+a+"`, but its value is `"+(null===n[o]?"null":"undefined")+"`."):null:e.apply(void 0,[n,o,a,i,c].concat(u))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function I(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||"Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol}(r,e)?"symbol":r}function X(e,t){return N((function(n,o,a,i,c){return r.untracked((function(){if(e&&I(n[o])===t.toLowerCase())return null;var i;switch(t){case"Array":i=r.isObservableArray;break;case"Object":i=r.isObservableObject;break;case"Map":i=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var s=n[o];if(!i(s)){var u=function(e){var r=I(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}(s),f=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+c+"` of type `"+u+"` supplied to `"+a+"`, expected `mobx.Observable"+t+"`"+f+".")}return null}))}))}function F(e,t){return N((function(n,o,a,i,c){for(var s=arguments.length,u=new Array(s>5?s-5:0),f=5;f<s;f++)u[f-5]=arguments[f];return r.untracked((function(){if("function"!=typeof t)return new Error("Property `"+c+"` of component `"+a+"` has invalid PropType notation.");var r=X(e,"Array")(n,o,a,i,c);if(r instanceof Error)return r;for(var s=n[o],f=0;f<s.length;f++)if((r=t.apply(void 0,[s,f,a,i,c+"["+f+"]"].concat(u)))instanceof Error)return r;return null}))}))}var W={observableArray:X(!1,"Array"),observableArrayOf:F.bind(null,!1),observableMap:X(!1,"Map"),observableObject:X(!1,"Object"),arrayOrObservableArray:X(!0,"Array"),arrayOrObservableArrayOf:F.bind(null,!0),objectOrObservableObject:X(!0,"Object")};if(!t.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available");Object.defineProperty(e,"Observer",{enumerable:!0,get:function(){return n.Observer}}),Object.defineProperty(e,"enableStaticRendering",{enumerable:!0,get:function(){return n.enableStaticRendering}}),Object.defineProperty(e,"isUsingStaticRendering",{enumerable:!0,get:function(){return n.isUsingStaticRendering}}),Object.defineProperty(e,"observerBatching",{enumerable:!0,get:function(){return n.observerBatching}}),Object.defineProperty(e,"useAsObservableSource",{enumerable:!0,get:function(){return n.useAsObservableSource}}),Object.defineProperty(e,"useLocalObservable",{enumerable:!0,get:function(){return n.useLocalObservable}}),Object.defineProperty(e,"useLocalStore",{enumerable:!0,get:function(){return n.useLocalStore}}),Object.defineProperty(e,"useObserver",{enumerable:!0,get:function(){return n.useObserver}}),Object.defineProperty(e,"useStaticRendering",{enumerable:!0,get:function(){return n.useStaticRendering}}),e.MobXProviderContext=_,e.PropTypes=W,e.Provider=M,e.disposeOnUnmount=function e(r,t){if(Array.isArray(t))return t.map((function(t){return e(r,t)}));var n=Object.getPrototypeOf(r).constructor,a=Object.getPrototypeOf(r.constructor),i=Object.getPrototypeOf(Object.getPrototypeOf(r));if(n!==o.Component&&n!==o.PureComponent&&a!==o.Component&&a!==o.PureComponent&&i!==o.Component&&i!==o.PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof t&&"function"!=typeof t&&!Array.isArray(t))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var c=!!r[q]||!!r[D];return("string"==typeof t?r[q]||(r[q]=[]):r[D]||(r[D]=[])).push(t),c||m(r,"componentWillUnmount",L),"string"!=typeof t?t:void 0},e.inject=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if("function"==typeof arguments[0]){var n=arguments[0];return function(e){return T(n,e,n.name,!0)}}return function(e){return T($(r),e,r.join("-"),!1)}},e.observer=k,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=mobxreact.umd.production.min.js.map |
{ | ||
"name": "mobx-react", | ||
"version": "7.0.4", | ||
"version": "7.0.5", | ||
"description": "React bindings for MobX. Create fully reactive components.", | ||
@@ -39,6 +39,6 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"mobx-react-lite": "^3.1.4" | ||
"mobx-react-lite": "^3.1.6" | ||
}, | ||
"peerDependencies": { | ||
"mobx": "^6.0.0", | ||
"mobx": "^6.0.4", | ||
"react": "^16.8.0 || ^17" | ||
@@ -55,4 +55,4 @@ }, | ||
"devDependencies": { | ||
"mobx": "^6.0.0", | ||
"mobx-react-lite": "^3.1.4" | ||
"mobx": "^6.0.4", | ||
"mobx-react-lite": "^3.1.6" | ||
}, | ||
@@ -69,3 +69,3 @@ "keywords": [ | ||
"lint": "eslint src/**/* --ext .js,.ts,.tsx", | ||
"build": "node ../../scripts/build.js mobxreact", | ||
"build": "node ../../scripts/build.js mobxReact", | ||
"build:test": "yarn build --target test", | ||
@@ -72,0 +72,0 @@ "test": "jest", |
@@ -14,4 +14,3 @@ # mobx-react | ||
Exports the `observer` decorator and other utilities. | ||
For documentation, see the [MobX](https://mobxjs.github.io/mobx) project. | ||
There is also work-in-progress [user guide](https://mobx-react.js.org) for additional information. | ||
For documentation, see the [MobX](https://mobx.js.org) project. | ||
This package supports both React and React Native. | ||
@@ -29,3 +28,3 @@ | ||
mobx-react 6 / 7 is a repackage of the smaller [mobx-react-lite](https://github.com/mobxjs/mobx-react-lite) package + following features from the `mobx-react@5` package added: | ||
mobx-react 6 / 7 is a repackage of the smaller [mobx-react-lite](https://github.com/mobxjs/mobx/tree/main/packages/mobx-react-lite) package + following features from the `mobx-react@5` package added: | ||
@@ -50,3 +49,3 @@ - Support for class based components for `observer` and `@observer` | ||
For greenfield projects you might want to consider to use [mobx-react-lite](https://github.com/mobxjs/mobx-react-lite), if you intend to only use function based components. `React.createContext` can be used to pass stores around. | ||
For greenfield projects you might want to consider to use [mobx-react-lite](https://github.com/mobxjs/mobx/tree/main/packages/mobx-react-lite), if you intend to only use function based components. `React.createContext` can be used to pass stores around. | ||
@@ -71,3 +70,3 @@ ## API documentation | ||
See the [MobX](https://mobxjs.github.io/mobx/refguide/observer-component.html) documentation for more details. | ||
See the [MobX](https://mobx.js.org/react-integration.html#react-integration) documentation for more details. | ||
@@ -206,3 +205,3 @@ ```javascript | ||
Decorators are currently a stage-2 ESNext feature. How to enable them is documented [here](https://github.com/mobxjs/mobx#enabling-decorators-optional). | ||
Decorators are currently a stage-2 ESNext feature. How to enable them is documented [here](https://mobx.js.org/enabling-decorators.html#enabling-decorators-). | ||
@@ -209,0 +208,0 @@ ### Should I still use smart and dumb components? |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
608178
0
506
Updatedmobx-react-lite@^3.1.6