everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React
https://www.react-laag.com
MIT License
907 stars 47 forks source link

Broken in Edge #14

Closed joelmoss closed 4 years ago

joelmoss commented 4 years ago

So it appears this is broken in Edge 18 (at least). Loading the tooltip example (https://pt2en.csb.app/) in Edge results in this error:

Unhandled promise rejection: Syntax error Expected identifier, string or number.

In my own app, simply importing the package also gives the same error on Edge.

Any ideas?

joelmoss commented 4 years ago

This https://codesandbox.io/s/tooltip-svqk4 fails...

import React from "react";
import "react-laag";
everweij commented 4 years ago

Thanks Joel for reporting this issue! You're absolutely correct, and I was able to reproduce this issue. I was stupid to forget to include the @babel/preset-env preset in the babel config, and I use object rest-spread in several places, which Edge does not support (es2018). Anyway, I released a fix, so if you upgrade to v1.4.2 it should now work.

everweij commented 4 years ago

I've upgraded the other code-sandboxes as well to 1.4.2 :)

joelmoss commented 4 years ago

Awesome! thx 👌