Comments (5)
Probably best as an option ? "reset" has different interpretations
from plate.
Adding an option sounds fine. Didn't resetEditor
behave like I described at one point?
from plate.
Reset has worked this way as long as I can remember. It’s possible it accidentally worked this way before separating value/initialValue.
The use case for the current behavior is switching pages or documents without recreating the editor component.
from plate.
@dylans Thanks for clarifying.
I usually use the trick of changing the key
prop when I want to reset an editor to its initial value. But this time, I was getting a strange error message that looked like it was coming from React's internals (not reproducible in a code sandbox), so I thought I'd try a resetting-based approach instead.
If the problem comes up again, I might introduce a new option to resetEditor
that tells it to use Plate's value
prop, but I'll stick with the workaround for now.
from plate.
It’s possible the behavior changed in switching Slate from React 16.x to 18.2, though we haven’t done much other than update the dependencies so far.
from plate.
Related Issues (20)
- Not Seeing All Nodes in Fixed Toolbar HOT 2
- When I type "//" it automatically turns into "÷" HOT 2
- Prefixes work incorrectly
- Mention input removed when clicking mention combobox scrollbar
- small mistake in superscript and subscript in playground HOT 1
- twMerge is missing config when using with tailwind prefixes HOT 1
- Compilation Error with '@udecode/plate-core' and 'nanoid/non-secure' in React App HOT 1
- serializeHtml of lists throws exception: The `useSlateStatic` hook must be used inside the <Slate> component's context. HOT 6
- [alignment] Doesn't support `'start'` and `'end'`
- plate-template repo uses outdated Plate packages HOT 4
- Cannot remove marks from mentions HOT 3
- Insert row/column in table does not account for merged cells HOT 1
- `useEditorRef` error when using YJS plugin HOT 4
- Action Required: Fix Renovate Configuration
- Initialization error HOT 1
- Trailing Block plugin isn't documented
- DnD issue with playground template HOT 2
- `serializeHtml` throws error when using list plugin HOT 1
- Named export `createClient` not found. Error when adding `cloud` plugins. HOT 2
- Toggle collapsible not showing an icon HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plate.