Skip to content

Cannot read properties of null (reading 'useReducer') #58

@corranmac

Description

@corranmac

Hi all,

Thanks for your open libraries, loving working with Solara so far!

I just discovered ipyreact also and I'm trying to see how easy it is for using react libraries with.

Currently trying to demo the react-pdf library and have overcome earlier errors but I'm now getting "Cannot read properties of null (reading 'useReducer')"

My code is the following:

import ipyreact

ipyreact.Widget(
    _esm="""
    import { Document, Page, pdfjs } from "https://esm.sh/react-pdf";
    import * as React from "react";


    pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`;

    export default function MyApp() {

      return (
        <div>
          <Document file="https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf" >
          </Document>
        </div>
      );
    };
    """
)

Hoping you might be able to advise.

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions