const useObservation = (
  render: () => JSX.Element,
  dependencies: React.DependencyList = []
) => {
  const ref = useRef<JSX.Element>();
  const [tick, setTick] = useState(0);

  useEffect(() => {
    return autorun(() => {
      ref.current = render();
      setTick(tick + 1);
    });
  }, dependencies);
    
  return ref.current;
};
    