You need to use let to capture the index, like:
let
{{#let rowIndex=@index}} {{#each cell in row}} <div class="cell {{cellState @index rowIndex}}">{{this}}</div> {{/each}}{{/let}}