droganov
droganov
Same issue when using koa-webpack with Webpack 5 internal/modules/cjs/loader.js:626 throw err; ^ ``` Error: Cannot find module 'webpack/lib/ParserHelpers' Require stack: - /www/maintined/rkta-starter/node_modules/webpack-hot-client/lib/compiler.js - /www/maintined/rkta-starter/node_modules/webpack-hot-client/lib/index.js - /www/maintined/rkta-starter/node_modules/koa-webpack/lib/client.js - /www/maintined/rkta-starter/node_modules/koa-webpack/lib/index.js ```
@ljharb withStyles takes thunk, options, not target (component)? and returns mustbe a decorator If I do ``` @withStyles(styleThunkFunc) export default class UiDropdown ``` The component gets decorated, but decorator does...
@ljharb the case is that there can be a need to access methods of decorated component from parent component. Here is the example, where button needs to open a dropdown,...
@ljharb I was able to solve this with custom ref prop: ``` {dropdown} ```
@ljharb the code I wrote works as a decorator, more than that you have a readme case for decoration: https://github.com/airbnb/react-with-styles#example-usage But anyway, my current solution is a hack. I've found...
@lencioni this is not about decoration actually, I'm interested in having access to wrapped component and I even provided a reference :-)
@ljharb I can't access wrapped component regardless of wrapping method: ``` ... export default withStyles(style, { pureComponent: true })(UiDropdown); ... // Button ... {dropdown} ... handleClick = (event) => {...
@ljharb sure! ``` import React, { PureComponent, PropTypes } from 'react'; import { Overlay, Paper, css, withStyles } from '../index.es6'; import { propTypes as overlayPropTypes } from '../ui-overlay/ui-overlay'; import style...
@ljharb it's in `UiButton` I posted it earlier ``` handleClick = (event) => { const { onClick } = this.props; if (this.dropdown) { event.preventDefault(); event.stopPropagation(); this.dropdown.show(); } else if (typeof...
@ljharb let me repeat it once again :-) it fails in **both cases** `` — `ref` points to withStyles HOC when I expect it to point to the wrapped component...