I want to share data between two components and in the second component , I want to use the data only , I do not want to display anything. Ex : share data from App.js to Strawberry.js and use it for some manipulations and not show it in html. THanks in Advance.
App.js
function App() {
let data1 = {
test : "Strawberry"
}
return (
<>
<div className="App">
<h1>Hello World!</h1>
<Apple></Apple>
<Banana></Banana>
</div>
<Strawberry data = {JSON.stringify(data1)}></Strawberry>
</>
);
}
Strawberry.js
export const Strawberry = (props) => {
console.log (props.data)
return props.data
}