0

I was looking through the react-data-grid source code and noticed this line: https://github.com/adazzle/react-data-grid/blob/34a2e51931bba2ac8a2f738cd059945d66516b48/packages/react-data-grid/src/HeaderCell.tsx#L107

    return x - this.cell.current!.getBoundingClientRect().left;

I can't seem to figure out what the ! is doing.

  • [Non-null assertion operator](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator) – ASDFGerte Dec 19 '19 at 00:51
  • Does this answer your question? [! operator in typescript after object method](https://stackoverflow.com/questions/38874928/operator-in-typescript-after-object-method) – ASDFGerte Dec 19 '19 at 00:52

1 Answers1

1

That means that you are sure that variable value this.cell.current is not undefined or null