Using react component @fluentui/react-components with Deno Fresh

43 Views Asked by At

I tried to import the react component @fluentui/react-components into deno fresh as follow:

https://esm.sh/@fluentui/[email protected]

Or

https://esm.sh/@fluentui/[email protected]?alias=react:preact/compat&alias=external:preact/compat&alias=react-dom:preact/compat

When I try to use it in my code:

import { Button } from 'https://esm.sh/@flu ...'
...
<div>
 <Button>Test</Button>
</div>

I got errors in the console:

An error occurred during route handling or page rendering.
TypeError: Cannot read properties of undefined (reading 'context')
    at Module.M (https://esm.sh/stable/[email protected]/X-YS9yZWFjdDpwcmVhY3QvY29tcGF0/denonext/hooks.js:2:1597)
    at R (https://esm.sh/v135/@fluentui/[email protected]/X-YS9yZWFjdDpwcmVhY3QvY29tcGF0/denonext/react-button.mjs:2:1046)
    at p (https://esm.sh/v135/@fluentui/[email protected]/X-YS9yZWFjdDpwcmVhY3QvY29tcGF0/denonext/react-button.mjs:2:1112)
    at https://esm.sh/v135/@fluentui/[email protected]/X-YS9yZWFjdDpwcmVhY3QvY29tcGF0/denonext/react-button.mjs:2:26963
    at Object.t (https://esm.sh/stable/[email protected]/X-YS9yZWFjdDpwcmVhY3QvY29tcGF0/denonext/compat.js:2:1586)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3237)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)

I tried the code in the island component but also no luck.

Can we use such component in fresh?

0

There are 0 best solutions below