Skip to content
Discussion options

You must be logged in to vote

The defaultValue prop in the RichText component actually doesn't do anything. Since that's intended, I'm closing this issue & converted it into a discussion. I've also removed this prop in 4bc5fa7 since it wasn't used.

The defaultValue of the richtext field is populated solely through the Form. The RichText component itself receives it as value from the useField hook - which is provided by that Form.

In order to give it a default value, you will have to set the initialState property of the Form component. Check out the Blocks Feature if you need an example of how initialState can be created & passed to the Form - I did something similar there

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Mng-dev-ai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
status: needs-triage Possible bug which hasn't been reproduced yet plugin: richtext-lexical @payloadcms/richtext-lexical
2 participants
Converted from issue

This discussion was converted from issue #4144 on November 14, 2023 17:37.