reactjsinternet-explorernext.jsrecoiljs

How to use React-recoil in IE11?


Is there a way to use react-recoil in IE11 ?

I know IE has been dead now, but somehow I need to support older browsers like IE11

I was just created a normal application using with create-next-app.

# in package.json
...
"dependencies": {
  ...
  "recoil": "^0.7.5",
  ...
}

When I try to use react-recoil, it keeps throwing endless errors like

This element does not support 'attachShadow'

The above error occurred in the <Portal> component:

 at Portal ...
 at ReactDevOverlay ...
 at construct ...
 at AppContainer ...
 at Root ...

React will try to recreate this component tree from scratch using the error boundary you provided, Container.

Does anyone know how to use react-recoil in IE11 ?

Thanks :)


Solution

  • According to the official doc, you need to compile your code with Babel and use preset @babel/preset-env. However, it is not recommended since ES6 is needed.