Essentially this comes down to an order of operations question when it comes to concentration, in Dungeons & Dragons 5th edition.
Say you have a smite spell cast on the previous turn, and you are concentrating on it. If you cast another spell that requires concentration right now, the smite spell will end. You have both an action and a bonus action ready this turn.
You attack and land the hit; you are now ready to apply damage from your weapon and your smite spell.
Are you still concentrating on your smite spell at this point in the attack sequence?
If you are not concentrating on your smite spell anymore, can you then use your bonus action to cast another smite spell and apply it to the attack before resolving the sequence of the attack, making a series of events that look like the following, assuming enough spell slots?
Example: a paladin
- previous turn:
cast thunderous smite, gain concentration - this turn:
Declare attack, starting your attack sequence. - Succeed in hitting your target
- Apply thunderous smite to your weapon attack, lose concentration
- Apply Divine Smite
- Use bonus action to cast thunderous smite, gain concentration
- Apply thunderous smite to your weapon attack, lose concentration.
- Roll damage for your weapon attack, your thunderous smite, your Divine Smite, and another thunderous smite.