Skip to main content

redo

PRO

The functionality is available in PRO Edition only

Description​

Allows performing steps forward in history

It's required to enable the undo property to perform the action.

Actions that can be undone: add-task, update-task, add-link, update-link, delete-task, delete-link, move-task, copy-task.

Hot key for the action: CTRL + Y

Usage​

"redo": () => void;

Parameters​

The callback of the action takes no parameters.

Example​

We enable the redo action on a button click.

import { useRef } from "react";
import { Gantt } from "@svar/react-gantt";
import { Button } from "@svar-ui/react-core";
import { getData } from "../data";

function App() {
const { tasks, links } = getData();
const api = useRef(null);

function redo() {
api.current.exec("redo");
}

return (
<>
<Button onClick={redo}>Redo</Button>
<Gantt ref={api} tasks={tasks} links={links} undo />
</>
);
}

export default App;

Related articles: