Open yuranrobin opened 5 years ago
Got an error first time using react-native-syntax-highlighter. Basically I copied code from expo snack from your main page.
"react-native-syntax-highlighter": "^2.0.0", "expo": "^27.1.1" "react-native": "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz",
My code:
import React from 'react'; import { Text, View } from 'react-native'; import SyntaxHighlighter from 'react-native-syntax-highlighter'; import { docco } from 'react-syntax-highlighter/styles/hljs'; import { tomorrow } from 'react-syntax-highlighter/styles/prism' export default class TestScreen extends React.Component { constructor(props) { super(props); this.state = { isLoading: true }; } componentDidMount() { ... } render() { const codeString = '(num) => num + 1'; return ( <View style={{ backgroundColor: '#E87A90', height: '100%'}}> <Text style={{ marginTop: 30, marginBottom: 30, textAlign: 'center', fontSize: 22, fontWeight: '900' }}>React Native Syntax Higlighter</Text> <SyntaxHighlighter style={tomorrow} customStyle={{padding: 0, margin: 0 }} language='javascript' fontSize={18} highlighter="prism" > {this.state.code} </SyntaxHighlighter> </View> ); } }
Expo on iOS:
Got an error first time using react-native-syntax-highlighter. Basically I copied code from expo snack from your main page.
My code:
Expo on iOS:![img_1826](https://user-images.githubusercontent.com/5099874/51087385-80f3f080-174a-11e9-9528-781516e7992b.PNG)