A vs Link

hello guys I have some question about solid-router, for example, there are two ways of navigating in solid Router the Link component and the A component, what is the differences between those, and also when we use solid-router, we are using SSR by default? for example in the docs I see you have to use renderToString to serve SSR components, by default solid is not SEO friendly as I see maybe I am wrong
2 Replies
apollo79
apollo7911mo ago
I think, talking about solid-router only and not solid-start, the Link nad A components are the same and it's just an alias (https://github.com/solidjs/solid-router/blob/4dda2a61768c7927e6d966062fb3efe6d366f2f3/src/components.tsx#L250). In solid-start, the link component is from solid-meta (https://github.com/solidjs/solid-meta) and meant for links in the head of a html document. About the SSR part: You are right, solid-js is a front-end-library, but it has mechanisms, that allow you to build sites with SSR. The same counts for react and the likes. Often you want to use a (meta-) framework, that supports SSR, like solid-start for solid
GitHub
GitHub - solidjs/solid-meta: Write meta tags to the document head
Write meta tags to the document head. Contribute to solidjs/solid-meta development by creating an account on GitHub.
GitHub
solid-router/src/components.tsx at 4dda2a61768c7927e6d966062fb3efe6...
A universal router for Solid inspired by Ember and React Router - solidjs/solid-router
AesthetiCoder
AesthetiCoder11mo ago
actually it is, i dont use solid start, i am using only solid-js, you can import that link from here import { Link } from '@solidjs/router'; maybe it has another use, like you say this works for just solid-js ? yes i think so and for solid-js router looks like export { A as Link, A as NavLink, AnchorProps as LinkProps, AnchorProps as NavLinkProps }; and all are deprecated alias, we should use only A yeah well thanks, i need to do it in solid-js i dont want to use solid-start in beta version because i do a lot of production projects
Want results from more Discord servers?
Add your server