TypeScript error: null
not allowed as theme
value for WordPressBlocksProvider
#1844
Open
1 task done
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: