  We present the cumulative star-formation histories (SFHs) of >15000 dwarf
galaxies ($M_{*}=10^{7-10}M_{\odot}$) from the TNG50 run of the IllustrisTNG
suite across a vast range of environments. The key factors determining the
dwarfs' SFHs are their status as central or satellite and their stellar mass,
with centrals and more massive dwarfs assembling their stellar mass at later
times on average compared to satellites and lower mass dwarfs. The satellites
(in hosts of total mass $M_{200c,\,host}=10^{12-14.3}M_{\odot}$) assembled 90%
of their z=0 stellar mass ~$7.0_{-5.5}^{+3.3}$ Gyr ago, while the centrals did
so only ~$1.0_{-0.5}^{+4.0}$ Gyr ago. TNG50 predicts a large diversity in SFHs
for both centrals and satellites, so that the stacked cumulative SFHs are
representative of the TNG50 dwarf populations only in an average sense and
individual dwarfs can have significantly different cumulative SFHs. Satellite
dwarfs with the highest stellar mass to host mass ratios have the latest
stellar mass assembly. Satellites at fixed stellar and host halo mass, found
closer to the cluster centre, or accreted at earlier times, show significantly
earlier stellar mass assembly. These trends, as well as the shapes of the SFHs
themselves, are a manifestation of the varying proportions within a given
subsample of quenched vs. star-forming galaxies, which exhibit markedly
distinct SFH shapes. We also find a subtle effect whereby satellite dwarfs in
the most massive hosts at z=0 have higher SFRs at early times, well before
final infall into their z=0 host, compared to a control sample of centrals
mass-matched at the time of accretion. This suggests that the large-scale
environment can have a mild effect even on future satellites by providing the
conditions for enhanced SF at early epochs. Our results are useful theoretical
predictions for comparison to future resolved-stellar-population observations.
