Bilişim dünyasına kaliteli, özgün ve Türkçe içerikler kazandırmayı hedefleyen bir platform..

friends friends friends

Adjacent JSX elements must be wrapped in an enclosing tag

React Native, jsx içinde return içinde sadece bir component yazmanıza izin verir. Eğer bir tane View kullandıysanız, diğer componentleri onun içine eklemelisiniz.

Hata:Adjacent JSX elements must be wrapped in an enclosing tag

Yanlış Kullanım

import React from 'react';
import { Text, View } from 'react-native';

const App = () => {
  return (
    <View>
      <Text>Hello, world!</Text>
    </View>
    <View>
      <Text>Hello, world!</Text>
    </View>
  )
}
export default App;

Doğru Kullanım 

import React from 'react';
import { Text, View } from 'react-native';

const App = () => {
  return (
    <View>
      <Text>Hello, world!</Text>
    </View>
  )
}
export default App;
React Native Hata Fragment Wrapper JSX
0 Beğeni
React-Native
Önceki Yazı

React native image source uri not showing

13 Ara. 2020 tarihinde yayınlandı.
Sonraki Yazı

Text strings must be rendered within a text component

13 Ara. 2020 tarihinde yayınlandı.
arrow