redocx icon indicating copy to clipboard operation
redocx copied to clipboard

Using Context Throws an Error

Open hazem3500 opened this issue 3 years ago • 0 comments

If you wrap the document with a context provider, it throws the error

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.\n\nCheck the render method of `ContextProvider`.

To Replicate

import React, {createContext} from 'react'
import { render, Document, Text } from 'redocx';

const ContextProvider = createContext().Provider

render(
    <ContextProvider>
        <Document>
            <Text>Hello</Text>
        </Document>
    </ContextProvider>
);

hazem3500 avatar Sep 21 '21 08:09 hazem3500