-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript error: null
not allowed as theme
value for WordPressBlocksProvider
#1844
Comments
Thank you @mdrayer. Would you be able to provide a PR for this? |
@theodesp sure, I can give that a go. Would it be best for me to fork the repo and do a PR that way? |
@mdrayer Make sure you fork the repo, make your changes, and open a PR against the Canary branch. We have a contribution guide: https://github.com/wpengine/faustjs/blob/canary/CONTRIBUTING.md#instructions-for-contributing-code You also need to complete a CLA form for first PRs Contributor License AgreementAll external contributors to WP Engine products must have a signed Contributor License Agreement (CLA) in place before the contribution may be accepted into any WP Engine codebase.
|
Description
If you provide
null
as the value fortheme
in your config forWordPressBlocksProvider
, you will get an error if your"strict"
flag is set totrue
.This is because the current type definition does not include
null
as a valid type:https://github.com/wpengine/faustjs/blob/canary/packages/blocks/src/components/WordPressBlocksProvider.tsx#L36-L39
To fix, the type should be updated to
theme?: BlocksTheme | null
.Steps to reproduce
"strict"
flag totrue
in tsconfig.@faustwp/blocks
.WordPressBlocksProvider
to your app and attempt to usenull
as thetheme
value for your config.The
Type 'null' is not assignable to type 'BlocksTheme | undefined'
error should appear in your TypeScript checks.Additional context
No response
@faustwp/core Version
3.0.0
@faustwp/cli Version
3.0.0
FaustWP Plugin Version
N/A
WordPress Version
N/A
Additional environment details
This issue is specific to the
@faustwp/blocks
package, versions 0.3.1 - 4.0.0.Please confirm that you have searched existing issues in the repo.
The text was updated successfully, but these errors were encountered: