payload
payload copied to clipboard
refactor: extract hasText helper in richTextValidateHOC
@AlessioGr
What?
Extracted hasText helper method in richTextValidateHOC
Why?
The new exported hasText helper method can now also be used during front-end serialization - for example, to check whether a caption element should be rendered when text is optional and therefore possibly empty (which would allow us to prevent rendering an empty caption element).
Are you expecting this to be used on the frontend?
Are you expecting this to be used on the frontend?
We use this in a couple of places, including our Solr plugin for Payload. It was useful for us. No worries if you'd rather not.
I'm happy the export it, it's just important to know where. If we export it from the root barrel file, that function can't be used on the client. And if we export it from /client, that function can't be used on the server.
I think this might be useful for both server & client. Could you export this function inside packages/richtext-lexical/src/exports/shared.ts ? Also make sure to move it to its own file
I'm happy the export it, it's just important to know where. If we export it from the root barrel file, that function can't be used on the client. And if we export it from /client, that function can't be used on the server.
I think this might be useful for both server & client. Could you export this function inside
packages/richtext-lexical/src/exports/shared.ts? Also make sure to move it to its own file
Okay sure. That sounds good.
🚀 This is included in version v3.2.0