Closed mateosilguero closed 5 years ago
do you have an example of when it comes in in an array or just random occurance?
the error mostly happens when i press the component (onPress).
It's detailed here: https://github.com/conorhastings/react-native-syntax-highlighter/issues/17
throws TypeError: value.includes is not a function
because Object.entries(style).reduce((newStyle, [key, value]) => {
value is not a string, because style is not an object, is an array with this schema: [{ stylesheet }, { opacity: 0.85 }]
i have this component:
import React from 'react';
import SyntaxHighlighter from 'react-native-syntax-highlighter';
import { obsidian } from 'react-syntax-highlighter/styles/hljs';
const C = props =>
<SyntaxHighlighter
language='javascript'
style={obsidian}
fontSize={17}
highlighter={'hljs'}
>
{'console.log()'}
</SyntaxHighlighter>;
got it, will merge for now while looking for al longer term solutiona
published as 2.0.1
Awesome !
Should we close the issue #17 ?
Count on me for anything that i could help you to find the real problem.
I don't know why, but sometimes 'stylesheet' comes as an Array like this [{ stylesheet }, { opacity: 0.85 }], instead of an Object, so this throws an error referenced at issue #17 So, this is a workaround, if the stylesheet is an Array, returns the first element, wich is the actual style object.