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

friends friends friends

Text strings must be rendered within a text component

React Native içinde bir string ifade kullanılacaksa bu Text componenti içinde yazılmalıdır. Eğer doğru kullanılmazsa aşağıdaki hatayı alırsınız.

Hata: Text strings must be rendered within a text component

Yanlış Kullanım

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

const App = () => {
  return (
    <>
	    <h1>Hello World</h1>//yanlış kullanımı
    </>
  )
}
export default App;

Doğru Kullanım

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

const App = () => {
  return (
    <>
	    <Text>Hello World</Text>//doğru kullanım
    </>
  )
}
export default App;
React Native
0 Beğeni
React-Native
Önceki Yazı

Adjacent JSX elements must be wrapped in an enclosing tag

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

CSS Sprite Tekniği

13 Ara. 2020 tarihinde yayınlandı.
arrow