In React:
wording.js
export const wording = {
id1: 'record',
id2: 'play'
};
test.js
import { wording } from "...";
function Test(props) {
const onCellClicked = (e) => {
console.log("Hello", wording.id1);
if(wording.id1 ) {
...
}
}
return (
<button onClick={onCellClicked} >Press me</button>
)
}
When I am calling and pressing the button, console.log responds correctly (getting record). However, by using Chrome Dev Tools and putting a break-point on if, wording is not defined!! Any logical explanation on that?


