Skip to content

Trouble with storybook #49

Description

@Dashue

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
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions