cht8687/react-hover

Hover Container dependence on child.type breaks behavior when minified

X-sam opened this issue · 6 comments

X-sam commented

https://github.com/cht8687/react-hover/blob/master/src/ReactHover.js#L45
if child.type is manipulated by uglify or other minifier, hover behavior fails.

@stevemao @shineli1984
Any ideas of how to tackle this problem?

minifier will only change variable names, not object field name. Can you supply any example when it fails?

X-sam commented

Default create-react-app uglify settings are sufficient to reproduce

      uglifyOptions: {
        parse: {
          ecma: 8,
        },
        compress: {
          ecma: 5,
          warnings: false,
          comparisons: false,
        },
        mangle: {
          safari10: true,
        },
        output: {
          ecma: 5,
          comments: false,
          ascii_only: true,
        },
      },

I may have miss understood your problem. What exactly is the problem? Stating details of what's expected and what's reality should help.

@sam-son This issue seems valid, we need think about a way to preserve the type not being minified.

@cht8687 I don't think minify is supposed to do that to files in node_modules, so I don't think this is a real issue.