0

I need to check my variables:

  return (
    <FileInfo> 
      <div>
        <FileSize>{fileSize}</FileSize> 
      </div>
    </FileInfo>
  );
};

const FilesContainer = ({ intl, files, onClickHandler, fullWidth }) => (
  <Container>
    <Label>
      {files} 
    </Label> 
  </Container>
);
 

I need to check my :

const FilesContainer = ({ intl, files, onClickHandler, fullWidth }) => (

my files variable ... when I console.log('files' , files) bellow example:

const FilesContainer = ({ intl, files, onClickHandler, fullWidth }) => (
  console.log('files' , files)
  <Container>
    <Label>
      {files} 
    </Label> 
  </Container>
);

I got error...how to check var ?

Phil
  • 157,677
  • 23
  • 242
  • 245
IvoryT
  • 1
  • 3
  • Make it `=> { console.log("files", files); return ... }` – Phil Dec 09 '21 at 22:26
  • If you need to debug your application, I highly recommend using a [debugger](https://developer.chrome.com/docs/devtools/javascript/). The console is for logging. – Phil Dec 09 '21 at 22:30

2 Answers2

0

Instead of implicit inline return, Use the function block and add console logs before the return statement.

const FilesContainer = ({ intl, files, onClickHandler, fullWidth }) => {
  console.log("files", files);
  return (
    <Container>
      <Label>{files}</Label>
    </Container>
  );
};
Siva K V
  • 10,561
  • 2
  • 16
  • 29
-3

Missing comma:

const FilesContainer = ({ intl, files, onClickHandler, fullWidth }) => (
  console.log('files' , files),
  <Container>
    <Label>
      {files} 
    </Label> 
  </Container>
);
fixiabis
  • 363
  • 1
  • 8