Skip to content

Conversation

@GermanJablo
Copy link
Contributor

Reproduction steps:

  1. Set strict: true in templates/website/tsconfig.json
  2. You will find a ts error in templates/website/src/components/RichText/index.tsx.

This is because the blockType property of blocks is generated by Payload as a literal (e.g. "mediaBlock") and cannot be assigned to a string.

To test this PR, you can make the change to JSXConvertersFunction in node_modules of the website template

@AlessioGr AlessioGr self-assigned this Jan 6, 2025
@AlessioGr AlessioGr self-requested a review January 6, 2025 17:46
@GermanJablo GermanJablo enabled auto-merge (squash) January 6, 2025 17:47
@GermanJablo GermanJablo merged commit d772b2b into main Jan 6, 2025
73 checks passed
@GermanJablo GermanJablo deleted the jsxConvertersFunction-type branch January 6, 2025 18:01
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2025

🚀 This is included in version v3.15.0

GermanJablo added a commit that referenced this pull request Jan 20, 2025
kendelljoseph pushed a commit that referenced this pull request Feb 21, 2025
…lock types in strict mode (#10398) Reproduction steps: 1. Set `strict: true` in `templates/website/tsconfig.json` 2. You will find a ts error in `templates/website/src/components/RichText/index.tsx`. This is because the blockType property of blocks is generated by Payload as a literal (e.g. "mediaBlock") and cannot be assigned to a string. To test this PR, you can make the change to `JSXConvertersFunction` in node_modules of the website template
kendelljoseph pushed a commit that referenced this pull request Feb 21, 2025
AlessioGr added a commit that referenced this pull request May 21, 2025
…JSXConvertersFunction type (#12478) Same as #10398 but for inline blocks. > Reproduction steps: > 1. Set `strict: true` in `templates/website/tsconfig.json` > 2. You will find a ts error in `templates/website/src/components/RichText/index.tsx`. > > This is because the blockType property of blocks is generated by Payload as a literal (e.g. "mediaBlock") and cannot be assigned to a string. > > To test this PR, you can make the change to `JSXConvertersFunction` in node_modules of the website template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment