Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Add a rerun button to react-live demos. #137

Open
parkerziegler opened this issue Apr 9, 2021 · 0 comments
Open

Add a rerun button to react-live demos. #137

parkerziegler opened this issue Apr 9, 2021 · 0 comments
Assignees

Comments

@parkerziegler
Copy link
Contributor

Currently, our docs site suffers a bit from our react-live sandboxes not being "rerun-able". Certain renature animation features, like delay, are best seen when you can catch the animation from the beginning. However, all react-live sandboxes begin running animations on mount (the default for renature), so these can get easily missed.

framer-motion solves this on their website by adding a "rerun" button to demos. For example:

image

Ideally, we could add a similar button that would restart the sandbox without fully unmounting every part of the LivePreview component.

An initial approach could be to use a useForceUpdate hook to re-render just the part of the sandbox responsible for rendering the LivePreview.

As far as icons go, I always recommend using the very nice (and free) set of Feather icons. Either of these should do: https://feathericons.com/?query=refresh

cc/ @upatel32

@upatel32 upatel32 self-assigned this Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants