It depends and is hard to generalize about.
If river volume is seasonal (think late summer in temperate countries, especially with snow-capped mountains or places with a specific rainy season), you could hike on exposed riverbank during periods of low flow. This is the sweet spot and if it works well, it's really beneficial (see fgysin reinstate Monica 's answer).
If the water reaches the forest, it could be slightly worse as it cuts off detouring on one side. Often I find tree branches and brushes overhang the river edge. Still, I don't know enough to generalize about all possible conditions.
However, in steep terrain, small streams often cut gullies in which debris accumulates and go through a series of small waterfalls, which are essentially cliffs, and slippery ones at that, making hiking possibly harder.
Also while a river with a bed of solid stone, earth, gravel or bigger pebbles may make for good trekking, some rivers instead have a bed made out of bigger rocks that can be quite unstable and/or covered with algae. In that case, you need to consider the risk of twisting an ankle or taking a bad fall ending on a hard rock, especially if loaded with heavy packs. Similarly, falling into a deep river with a backpack can be extremely dangerous, as you can drown really easily. The West Coast Trail has had several fatalities on the low tide rock flats, where there are some small tidal channels to cross.
Last, riverbeds can become very dangerous if there is a sudden rise of water due to heavy rain upstream, possibly not even noticeable where you are. Or any other reason for this happening (such as dam releases - is there an upstream dam?). This is doubly so if you decide to camp in that area. Be aware of weather risks and be sure you could quickly gain higher ground if needed. Canyon-type terrain, where there are cliffs on either side of the river, can be quite dangerous and should, in my opinion, best be avoided.
River conditions, as noted, can vary. Plan on what you would do if the water level changed by your return trip. Carry a PLB rescue beacon.
(For reference I live in Vancouver, which is characterized by mountainous and broken terrain, lots of water and dense forests with thick underbrush. We have large seasonal variations in river levels. Even coastal forests are hard to walk through without trails. We also have a high frequency of outdoor accidents to hear about).
Edit: while it is hard to generalize about river hiking, informed locals or past hikers could make a reasonable guess whether a particular stretch of a specific river in a given time frame could be hiked or not (keeping in mind that the timing low/high water seasons will vary year to year). You could call park rangers or read trail reviews online, for example.