我尝试添加“react-native-css-gradient”,但出现此错误。
import Gradient from 'react-native-css-gradient`; // Here <--- Unterminated string literal.ts(1002)
import React, {Component} from 'react';
import {StyleSheet, Text, View, TextInput, Image,} from 'react-native';
export default class App extends Component {
render() {
return (
最佳答案
您不小心输入了错误的反引号字符而不是单引号。
反引号:` 单引号:'
第一行应该是:
import Gradient from 'react-native-css-gradient';
应该是一个快速修复。
关于javascript - 未终止的字符串 literal.ts(1002),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55733599/