Skip to content

[feat]Add useHistory State Hook (@termuijs/jsx) #3442

Description

@karthikj5453

Which package?

@termuijs/jsx

What happened?

Interactive CLI applications built with @termuijs/jsx (such as text editors, form flows, and terminal canvas/layout builders) often require state undo/redo capability. Currently, @termuijs/jsx lacks a useHistory hook for managing past/present/future state stacks with undo, redo, canUndo, canRedo, and clear actions.

Steps to reproduce

import { useHistory } from '@termuijs/jsx';

function EditorComponent() {
    const [state, { set, undo, redo, canUndo, canRedo, clear }] = useHistory('Initial content');

    // useHistory is not yet available in @termuijs/jsx
}

## GSSoC contributor?

- [x] Yes. You contribute under GSSoC 2026 and want to work on this.

i would love to work on this issue

Metadata

Metadata

Assignees

Labels

assignedIssue claimed by a contributor.type:feature+10 pts. New feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions