Skip to content
Discussion options

You must be logged in to vote

Solved it.

I had to set the fetchResults function as a parameter to CsvReader, and treat CsvReader as a child component to DataTable

function CSVReader({fetchResults}) {
  const { CSVReader } = useCSVReader();

  function render({
    getRootProps,
    acceptedFile,
    ProgressBar,
    getRemoveFileProps
  }) {
    return (
      <Aside>
        <ButtonBrowse {...getRootProps()}>Browse file</ButtonBrowse>
        <LoadedFile>{acceptedFile && acceptedFile.name}</LoadedFile>
        <ButtonRemove {...getRemoveFileProps()}>Remove</ButtonRemove>
        <ProgressBar />
      </Aside>
    );
  }

  console.log("---------------------------");
  console.log(state);
  console.log("--------------…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Diego-Hernandez-Moodys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant