Exactly right. China didn’t fully control Formosa until 1887, when the Manchu Imperial authorities decided to declare Taiwan to be part of their Empire. The intention was to outmaneuver the Japanese, who were expanding their influence to the South. In 1895 the Japanese defeated the Manchu’s in the Sino-Japanese War, and in the Treaty of Shimonoseki, China ceded Taiwan to Japan in perpetuity (not 99 years, like Hong Kong’s New Territories, but in perpetuity, i.e. forever). The Taiwanese didn’t like this idea, and actually declared the formation of the first independent republic in Asia. However, the movement was short-lived: Japanese imperial troops crushed the movement within several months.