Reputation: 329
I would have thought that react alone would be sufficient for the front end of a spring boot application but examples I have seen use also Thymeleaf. Can Thhymeleaf be eliminated? But if so, is it still useful?
Upvotes: 3
Views: 7974
Reputation: 26
Thymeleaf is not necessary for a Spring Boot/React application. You can serve up standard HTML files and add whatever ids that are necessary for your react project in those HTML files. You can serve up an HTML file from your src/main/resources/templates/ folder like so:
/**
* Returns the home page.
*
* @return index
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String getHomePage() {
return "index";
}
Upvotes: 1