[SalesForce] lightning:datatable link to sObject

Do you have to use the url data type to navigate to a sObject like how it is on list views?

For example, this is the data table which I want to refactor to use the base datatable lightning component:

enter image description here

We are using an HTML table with slds styling currently. I try to avoid hard coding urls when possible but it doesn't seem like this is possible currently. Am I missing something or is that how it is done.

Best Answer

As of Summer '18, you can use lightning:navigation to navigate to a SObject record or other pages within Salesforce without having to hardcode URLs.