example is data.js export const x={value:0}
;
in app.js :
import { x } from "./data";
function App() {
return (
<div>
{console.log("Re-render")}
{x.value}
</div>
);
}
export default App;
when i manually change the x.value in data.js react is reloading/re-rendering. why ?
i thought then value of x.value would stay 0 even if i changes its value manually to 100;