State to State move . How bonus is taxed

I moved from one state to another in 2021 (for arguements sake, lets say 60% of yr was spent in State 1 and 40% in, my new state, State 2 .  I received a bonus payment in Feb., 2022 , which was based on my 2021 performance.  Do I owe income tax in State 1 because the bonus received in 2022 was based on my 2021 performance?  Since moving to State 2 my employer has only been withholding tax for State #2.  However on my separate bonus check they withheld tax on 60% of this income in State 1 and 40% in State 2.  Looking to understand what is correct so I know how to file 2022 tax return, next year, appropriately.