What to do instead? Either start your own open source project (if you have ideas for something useful) or contribute to one of many existing projects (pick something with decent name recognition).
If you're into low-level coding, contribute to Rust. If you're into front-end, JavaScript, contribute to atom.io (those are just random examples, the point is that for anything that you might be interested in, there is an open source project in that area that is desperate for more developers).
A meaningful contribution to a well-known open-source project will be much more interesting to your future potential employer than random unpaid work for a random company.
At the same time pick the project carefully. There are many projects that are not good at onboarding new developers so submit small fixes (Pull Requests in GitHub speak) to a few that interest you and pick those that are quick providing feedback (even if it's to reject a PR as long as they do it in a nice way and explain why) and drop those that are unresponsive.