conorhastings / conorhastings/react-native-syntax-highlighter
Can not add child that doesn't have YogaNode to a parent
- Dominant language
- JavaScript
- Stars
- 184
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
Hello Conor,
I got an error while I am using `react-native-syntax-highlighter` inside `react-native-render-html`.
**I got this error:**

**Here is my code**
```
import React from 'react';
import { View } from 'react-native';
import Html from 'react-native-render-html';
import SyntaxHighlighter from 'react-native-syntax-highlighter';
const contentTest = `
Hello
<html><head>
</head><body>
</body></html>
export default class SyntaxHighlighterTest extends React.Component{
render(){
return (
{
return {contentTest}
}
}}
/>
);
}
}
```
### I found that the content I am passing has an issue
If I am using this content without `
` tag then it is working fine:
**Working**
```
const contentTest = `
<html><head>
</head><body>
</body></html>
```

**Not Working**
```
const contentTest = `
Hello
<html><head>
</head><body>
</body></html>
```
### So `SyntaxHighlighter ` takes content that has only one child in parent tag.
**Note:** It is working when I am using this outside of `react-native-render-html`, but I want to use within html renderer.
What will be the best practice to resolve this issue ?
Thank you
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.