How to work on with Marked Library

I have problems using marked in my React app project. I have included this in JS settings but it throws an error upon this line preview: marked(markedInput). How do I solve this error or do I have to include import code in my JS file?