a 0-th approximation of react-cursor implementation