I am having trouble getting a boolean
value from a separate component file to display properly in my main App.js
file.
I created a separate file called Component.js
where I defined a boolean variable called "test" and exported it. In App.js
, I imported the variable and logged it to the console. However, the console is showing me the entire Component
function definition instead of the boolean
value.
This is my App.js
:
import React, { useState } from "react";
import "./App.css";
import test from './Component'
export default function App() {
console.log(test)
return (
<>
</>
)
}
This is my Component.js
import React, { useState } from "react";
export const test = true;
export default function Component() {
}