I am trying to pass an object as a prop, but I am receiving it as undefined in the child component. If I try the same thing in codesandox works perfect. Any thoughts?
This an example:
Parent Component
import TestPage from "pages/Test";
const text = {
crono: "crono",
watch: "clock",
start: "start",
stop: "stop",
split: "split",
pause: "pause",
clear: "clear",
};
export default function Base() {
return (
<section className="main-container">
<TestPage text={text} />
</section>
);
}
Child Component
export default function Test({ text }) {
console.log(text);
return <h1>{text.split}</h1>;
}
here is the complete project