Using the Razor Class Library for packaging and reusability
We have created plenty of components in this chapter and the previous one, but as you may have noticed, all those components are mostly located in the same project within the Shared
folder. So, you may have wondered how to use the exact same component in other projects within the same solution or maybe within a totally different solution.
.NET offers another type of project called the Razor Class Library, and the main purpose of this project is to have a Blazor component, and then you can reference this project within your other projects, solutions, your entire organization, or even publish it as a NuGet package so it could be used by other developers worldwide.
In this section, we will create a new Razor Class Library project, reference it within our Books Store project, and learn how to reference static resources such as CSS and JavaScript files within our Blazor WebAssembly project.
Sometimes, reusability is not...