import { useEffect, useState } from 'react';
import { runInAction } from 'mobx';
import { safelyMakeObservable } from '../util';
export function useSyncProps(props, annotations) {
    const [syncedProps] = useState(() => safelyMakeObservable(props, annotations, {
        deep: false,
    }));
    // sync all props using Object.assign on every render (as not passing deps to useEffect)
    useEffect(() => {
        runInAction(() => {
            Object.assign(syncedProps, props);
        });
    });
    return syncedProps;
}
//# sourceMappingURL=useSyncProps.js.map