Lin-Manuel Miranda has said penning hit musical Hamilton has encouraged him to “take more vacations”.

The composer wrote the Broadway and West End smash after reading a biography of US founding father Alexander Hamilton while on holiday.

Miranda ended his run in the starring role of the musical to play lamplighter Jack, an apprentice of Dick Van Dyke’s Bert, in Mary Poppins Returns, and said he could not panic about how he would follow up something as successful as Hamilton.

He told the Press Association: “You can’t worry about that. The lessons I try to hang on to from Hamilton are – it was one of the best ideas I ever had and it happened while I was on vacation, so take more vacations, and I would pitch this to my friends and everyone would go ‘Great Lin, good luck with that’.

“It’s a crazy idea and so it fortified my trust in my own gut and my own instincts and those are good lessons to take away.

“When you feel the pressure of the success of a thing then you go, ‘Well I got here because I took a vacation and I trusted my gut so I’m just going to have to continue to do that’.”

Miranda said landing his role in Mary Poppins Returns, opposite Emily Blunt as the titular character, is the reason he put in so much hard work penning both Hamilton and his previous musical In The Heights.

He said: “I knew if I was going to have a life in musical theatre I was going to have to create my own opportunities and so I wrote In The Heights and Hamilton and this is the fruit of all that hard work, to get offered a role of this calibre, with this company.”

He added: “My son was just old enough to understand it, that daddy gets to play with Mary Poppins all day and he became friends with Emily’s children and so they were on the set together and sneaking candy from the ADs (assistant directors) whenever they could, it was a wonderful place to take children to work.”

Miranda will next be seen playing Lee Scoresby in the BBC’s adaptation of Philip Pullman’s His Dark Materials books and said that was also a passion project.

He said: “Thanks to Hamilton I don’t have to take a gig for the money, I get to work on things I’m really passionate about and I love those books.

“With the His Dark Materials books, my wife and I would read them together when we started dating and they were a magical thing to fall in love with while you’re reading those books and so it was a total joy to film the first season of that.

“I will go back to Cardiff next summer and film season two, which is book two, and it’s just been wonderful.”

Mary Poppins Returns is out in UK cinemas now.