I have been doing a course which teaches you about Deep Neural Networks, during one of the exercises I was made to make an RNN for sentiment classification which I did, but I did not understand how an RNN is able to deal with sentences of different lengths while conducting sentiment classification.
The RNN doesn't care the length of the original sentences, because all data it takes have the same length. Converting all sentences in the same length is about the method which you use in the data processing step. For example the simplest method is Bag of Words -> https://machinelearningmastery.com/gentle-introduction-bag-words-model/
So, the given sentences to the RNN have the same length and it is equal to the numbers of the input layer's neurons, otherwise the RNN throws an error.