const [raster] = useState<Raster>(new L.RasterCoords(map, imageDimensions))
Set map max Bounds with value that inst same as value for raster layer bounds f.e use padding
map.setMaxBounds(raster.getMaxBounds().pad(1))
Change state or re-render the component and whole bounds are set to max bounds of raster layer (raster-coords overrides our settings on re-render)
<TileLayer
bounds={raster.getMaxBounds()}
...
/>
Just add new param that can disable setting maxBounds with default value (backward-compability)
L.RasterCoords = function (map, imgsize, tilesize, setmaxbounds = true) {
if (setmaxbounds && this.width && this.height) {
this.setMaxBounds()
}