The risk is nonexistent, and the strength of those small magnets isn’t even close to the strength of the magnets inside the hard drive already.
Further, if your laptop or desktop computer has only solid state drives, then there is no magnetic drive or magnetized data to damage in the first place.The answer to whether or not magnets can damage your phone is actually more nuanced than you would think.The strength and placement of the magnets in the accessories are carefully tuned to avoid issues with the phone model in question
And as far as magnets in general go, the same advice about computers applies to phones: don’t subject your phone to extremely powerful magnets like those used to degauss hard drivesEven though there’s no tiny hard drive in your phone you can erase, you don’t want to risk a very rare (but theoretically possible) outcome like magnetizing components inside the phone in a way that permanently throws off those delicate sensorsKeep your electronics, laptops, phones, or other gear, away from industrial apparatus designed to wipe hard drives or other equally powerful magnets, however, and you’ll be fine