I began to learn React Native recently, I hope someone will help me.
I've tried for hours to make the following code work with React Native: ResultList.js from simple-dictionary. The problem is the plain HTML here:
return (
<div className="bg-gray-700">
<div className="container mx-auto py-8">
<h1 className="text-3xl font-bold text-center text-white">Simple Dictionary</h1>
<p className="text-center mt-1 mb-10 text-slate-300 text-lg">Find definisions for word</p>
<div className="flex items-center justify-center mt-5">
<div className="flex border-2 border-gray-200 rounded">
<input className="px-4 py-2 md:w-80" type="text" placeholder="Search..." onChange={handleInputChange} value={value} onKeyDown={handleInputKeyDown} />
<button className="bg-blue-400 border-l px-4 py-2 text-white" onClick={handleSubmit}>Search</button>
</div>
</div>
{ inputValue && (
<h3 className="text-gray-50 text-center mt-4">Result for: <span className="text-white font-bold">{inputValue}</span></h3>
) }
</div>
</div>
The error is
ERROR Error: Text strings must be rendered within a <Text> component.
This error is located at:
in h1 (created by SearchHeader)
in div (created by SearchHeader)
in div (created by SearchHeader)
in SearchHeader (created by App)
in div (created by App)
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in AwesomeProject(RootComponent), js engine: hermes
I tried "WebView" ... no success ... what should I do?
Kind regards, Frank
Edit: I oversaw the tailwind initialization ... I proceeded the way described in the documentation, the build process was started by
npx react-native run-android
but the same error ... I don't what I'm doing wrong.