There could still be snow/ice on the roads in Yosemite. Here is a link to save driving in the park and their requirements for tire chains.
They do take the tire chain thing very seriously as there areas where there are no guard rails and steep cliff drop-offs just beyond the shoulder.
When I was there last February, we rented a four wheel drive SUV with M&S (mud and snow) rated tires. We purchased tire chains on the way to the park (about $120 USD) just in case and to be safe. We did have snow and ice but never bad enough that the vehicle we had required chains be installed. However, there was one day when there was enough ice that the park rangers stopped all cars to check for four wheel drive and M&S tires. Those without were forced to install chains. If they didn't have chains, they had a choice: have the vehicle towed out of the park or wait for the "chain jockeys" to arrive who would sell and install chains...no idea what that cost.
Also, the car rental companies in California typically stipulate that installing tire chains on their vehicles voids insurance for damage caused by the chains.
Hmm, we shall plan for a detour for sure. I hope it isn’t going to be bad.