Closed toomim closed 9 years ago
How might I learn how hyperlinks work now?
You could follow those referenced commits. Or browse browser_location.coffee.
Michael Toomim wrote:
How might I learn how hyperlinks work now?
— Reply to this email directly or view it on GitHub https://github.com/tkriplean/ConsiderIt/issues/35#issuecomment-104778617.
Ok thanks. I actually opened up the commits but it was over a thousand lines of diffs to understand. browser_location.coffee looks better. I'm most interested in how to use it as a developer who wants to make a hyperlink.
Cool, thanks for clarifying.
As a developer, you don't need to do anything special.
Internal link:
A
style: {color: '#888'}
href: "/proposal/23432/edit"
'Edit'
External link:
A
style: {color: '#888'}
href: "http://google.com"
'Google'
There are some esoteric options, but the basics almost always work.
One caveat is that internal links must be relative.
onClick handlers will work on your links.
Michael Toomim wrote:
Ok thanks. I actually opened up the commits but it was over a thousand lines of diffs to understand. browser_location.coffee looks better. I'm most interested in how to use it as a developer who wants to make a hyperlink.
— Reply to this email directly or view it on GitHub https://github.com/tkriplean/ConsiderIt/issues/35#issuecomment-104783567.
Ok so here's what I'm learning:
I'm guessing there might also be some sort of conventions for designing your react components to depend on the path... like seeing "/paper_43" and then extracting out the paper_43 part and knowing to load that page. But I bet for consider.it so far it's so simple that this is probably just done by hand somewhere in franklin.
Thank you. This is very cool.
The "router" / Page in considerit is now just a component that depends on the location key.
https://github.com/tkriplean/ConsiderIt/blob/master/%40client/franklin.coffee#L2977
Michael Toomim wrote:
I'm guessing there might also be some sort of conventions for designing your react components to depend on the path... like seeing "/paper_43" and then extracting out the paper_43 part and knowing to load that page. But I bet for consider.it so far it's so simple that this is probably just done by hand somewhere in franklin.
— Reply to this email directly or view it on GitHub https://github.com/tkriplean/ConsiderIt/issues/35#issuecomment-104785304.
Glad you like it. I imagine it can be improved upon. I only took it a certain distance and moved on.
Michael Toomim wrote:
Thank you. This is very cool.
— Reply to this email directly or view it on GitHub https://github.com/tkriplean/ConsiderIt/issues/35#issuecomment-104785576.
Ok cool. That explains the full loop. Thanks!
&selected=%2Fpoint%2F3466
from the homepage. It gets stripped from the url.