Huck's reaction to Jim's disappearance is immediate, though somewhat mixed. His initial reaction is to sit down and cry. He is angry with the King and the Duke.
While Huck was already prepared to break with the King and the Duke, he is relieved now to have a good reason to leave them behind. When they betray Jim and sell him back into slavery, Huck is no longer divided about his duty regarding this pair of swindlers. His allegiance to them is ended.
Though Huck is released from any considerations of the King and the Duke, he next contemplates his allegiance to Miss Watson. Huck writes a letter to her to clear his conscience before deciding once and for all to follow his own mind. He tears up the letter when he realizes that Jim is his friend and he is Jim's friend and he will suffer damnation for acting on this sense of friendship if need be.
Rather than betray Jim, though, Huck decides, "All right, then, I'll go to hell."
This decision is critical to the themes of the novel, as in this moment Huck faces up to the fact that society's norms and rules do not match his own moral thinking. His moral instruction does not match his moral instinct.
For much of the novel, Huck suffers from a sense that he is incapable of doing the right thing and acting morally.
Huck fails to recognize that he has taken a stand against a morally corrupt society.
When Jim is sold by the King and the Duke, Huck finally decides to accept his own moral vision and act upon it, preferring to follow his heart since his conscience will harass him no matter what course he takes. This is true because Huck still cannot doubt the validity of social norms. He is, however, willing to go against them to save his friend.