withState
Creates a new snapshot with the specified state.
This method allows creating a modified copy of the snapshot with different state data, while preserving all other metadata.
Return
A new snapshot instance with the updated state.
Parameters
state
The new state data for the snapshot.