violentmonkey / generator-userscript

A yeoman generator to create a userscript project rapidly
95 stars 5 forks source link

cant use react's useeffect, usestate #10

Closed WiLuX-Source closed 1 year ago

WiLuX-Source commented 1 year ago

Hello there,

I'm using this template in my project with my modifications on it for my convenience, any idea why my userscript gives error when i try to use react api?

https://gist.github.com/WiLuX-Source/fd9ac9164ea889f809c20e4a467f9641

gera2ld commented 1 year ago

Because React is not supported by default. You need to modify babel and rollup config accordingly to support React.