[Bug]: react/jsx-no-literals
crashes with Cannot read properties of null (reading 'type')
#3822
Closed
2 tasks done
Labels
Is there an existing issue for this?
Description Overview
Trying the latest v7.36.0 version of the plugin, we're seeing crashes such as:
That specific line is
fullWidth
inThe failure seems to be due to b8217ed removing the
node && node.value &&
checks from the newisLiteralString
andisStringLiteral
calculations, which were present in the previousisNodeValueString
. Just changing both those checks to donode.value?.type
fixes the issue, and it seems like it should be safe, but you might want to make sure (happy to send a PR if that's the case).Expected Behavior
The plugin should not crash and should understand there's no issue with this code.
eslint-plugin-react version
v7.36.0
eslint version
v8.57.0
node version
v22.8.0
The text was updated successfully, but these errors were encountered: