useDocumentTitle With Cleanup

ReactJS Medium 5 views
Back to Questions

Problem Description

Create a hook that sets document.title and resets it on unmount.

Input Format

No input.

Output Format

Render a React component.

Constraints

Store previous title and restore it in cleanup.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next