Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with storybook #49

Open
Dashue opened this issue Apr 13, 2020 · 1 comment
Open

Trouble with storybook #49

Dashue opened this issue Apr 13, 2020 · 1 comment

Comments

@Dashue
Copy link
Contributor

Dashue commented Apr 13, 2020

Trying to use this library in storybook ends up with the following exception:

Cannot update a component (`WindowTable`) while rendering a different component (`AutoSizer`). To locate the bad setState() call inside `AutoSizer`, follow the stack trace as described in https://fb.me/setstate-in-render
    in AutoSizer (created by Measurer)
    in Measurer (created by WindowTable)
    in tr (created by HeaderRowRenderer)
    in thead (created by THead)
    in THead (created by HeaderRowRenderer)
    in HeaderRowRenderer (created by WindowTable)
    in table (created by WindowTable)
    in div (created by WindowTable)
    in WindowTable
    in WindowTable (created by Html5Table)
    in Html5Table
    in Unknown (created by Table)
    in Table (created by storyFn)

In this method

var Measurer = function Measurer(_ref2) {
  var measure = _ref2.measure,
      entity = _ref2.entity,
      debounceWait = _ref2.debounceWait,
      _ref2$innerElementTyp = _ref2.innerElementType,
      innerElementType = _ref2$innerElementTyp === void 0 ? 'div' : _ref2$innerElementTyp;
  var debounced = useMemo(function () {
    return debounce(measure, debounceWait, {
      leading: true
    });
  }, [measure, debounceWait]);
  var dispatch = debounceWait > 0 ? debounced : measure;
  return createElement(AutoSizer, {
    innerElementType: innerElementType
  }, function (_ref3) {
    var height = _ref3.height,
        width = _ref3.width;
    dispatch({
      dimensions: [height, width],
      entity: entity
    });
    return null;
  });
};

On this line:

 dispatch({
      dimensions: [height, width],
      entity: entity
    });
@18601673727
Copy link

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants