Check out example codes for "roam research". It will help you in understanding the concepts better.

Code Example 1

javascript:(function(){let text=""; if(window.getSelection()!=''){text=window.getSelection().toString();}prompt("Press CTRL+C or CMD+C, then escape and paste into Roam.", "%5F%5F"+text+"%5F%5F%20—%20via%20%5B"+document.title+"%5D%28"+location.href+"%29");})()

Learn ReactJs, React Native from akashmittal.com