I think international law doesn't have a lot say about this. In the Kosovo case, which is probably the one that got the most "lawyered" in recent memory, the conclusion of the ICJ was that under some circumstances international law doesn't make it illegal, i.e. it's what one might call a "political question" (in some legal systems). To quote myself from a what I said to a related Q:
It's also (perhaps) worth noting in this regard that even more ambiguous statements ... of ambiguity such as the famous UNSC resolution 1244, which guaranteed the territorial integrity of the Federal Republic of Yugoslavia (FRY) but without explicitly committing to whether Kosovo was or wasn't part of that guarantee, while speaking of a need for a "final settlement" for the latter territory have led to Kosovo's independence being fairly broadly recognized. (Kosovo is recognized as independent by about half the UN countries, mostly Western ones, but not by China and Russia, and probably most developing countries fall in the latter category [of non-recognition] as well.) In their advisory opinion, the majority of the ICJ judges have explicitly relied on the ambiguity of UNSCR 1244 as not precluding Kosovo's independence, in conjunction with the fact that FRY had not exercised "continuing sovereignty" over Kosovo (in Kosovo's case that was due to UN temporary administration being imposed over the territory following human rights violations by FRY forces.)
So the the lack of "continuing sovereignty" of the PRC over Taiwan (as in never exercised) can indeed be argued as highly relevant, although I'm not sure if the US (through its official representatives) has elaborated on this point in re Taiwan, especially in recent times.
The ICJ's own press release/summary:
The Court first sought to determine whether the declaration of independence was in accordance with general international law. It noted that State practice during the eighteenth, nineteenth and early twentieth centuries “points clearly to the conclusion that international law contained no prohibition of declarations of independence”. In particular, the Court concluded that “the scope of the principle of territorial integrity is confined to the sphere of relations between States”. It also determined that no general prohibition of declarations of independence could be deduced from Security Council resolutions condemning other declarations of independence, because those declarations of independence had been made in the context of an unlawful use of force or a violation of a jus cogens norm. The Court thus concluded that the declaration of independence in respect of Kosovo had not violated general international law.
[...] resolution 1244 was silent on the final status of Kosovo, whereas the declaration of independence was an attempt to finally determine that status.
The ICJ opinion essentially does state that the UNSC has the power to declare some such declarations illegal
[112. ...] if the Security Council
had wanted to preclude a declaration of independence, it would have
done so in clear and unequivocal terms in the text of the resolution, as it
did in resolution 787 (1992) concerning the Republika Srpska. [...]
[114. ...] For
example, although the factual circumstances differed from the situation
in Kosovo, only 19 days after the adoption of resolution 1244 (1999), the
Security Council, in its resolution 1251 of 29 June 1999, reaffirmed its
position that a “Cyprus settlement must be based on a State of Cyprus
with a single sovereignty and international personality and a single citizenship,
with its independence and territorial integrity safeguarded”
(para. 11). The Security Council thus set out the specific conditions relating
to the permanent status of Cyprus.
By contrast, under the terms of resolution 1244 (1999) the Security
Council did not reserve for itself the final determination of the situation
in Kosovo and remained silent on the conditions for the final status of
So yeah, it's more or less at the whim of the UNSC to declare declarations of independence illegal, if they can get a consensus for that, and that lays down the [international] law in specific cases, in the negative sense, as a prohibition in specific cases, as far as the ICJ was concerned.
The issue of "continuing sovereignty" isn't argued anywhere at the same length in the ICJ opinion (it's mentioned in the preamble and at para 98) but I think one could argue that a distinguishing factor was that the interruption of Serbia's continuing sovereignty over some parts of its territory was itself a UNSC decision, whereas e.g. in Cyprus or Republika Srpska case, the UNSC didn't even agree to that much, i.e. to suspend Bosnia or Cyprus' sovereignty over parts of its territory.