Closed NickyMeuleman closed 1 year ago
WebpackError: TypeError: Cannot read properties of undefined (reading 'includes')
const Div = ({ className, children, ...rest }) => { > 6 | if (className.includes(`math-display`)) { | ^ 7 | return <MathBlock math={children} {...rest} />; 8 | } 9 | return (
This happens because there is no className before remark-math adds it to a block. This causes includes to be called on undefined.
className
remark-math
includes
undefined
Hint: optional chaining to not call includes if there is no className yet.
WebpackError: TypeError: Cannot read properties of undefined (reading 'includes')
This happens because there is no
className
beforeremark-math
adds it to a block. This causesincludes
to be called onundefined
.Hint: optional chaining to not call
includes
if there is noclassName
yet.