"use strict";

exports.__esModule = true;
exports.useSyncProps = useSyncProps;
var _react = require("react");
var _mobx = require("mobx");
var _util = require("../util");
function useSyncProps(props, annotations) {
  const [syncedProps] = (0, _react.useState)(() => (0, _util.safelyMakeObservable)(props, annotations, {
    deep: false
  }));

  // sync all props using Object.assign on every render (as not passing deps to useEffect)
  (0, _react.useEffect)(() => {
    (0, _mobx.runInAction)(() => {
      Object.assign(syncedProps, props);
    });
  });
  return syncedProps;
}
//# sourceMappingURL=useSyncProps.js.map