Skip to content

Instantly share code, notes, and snippets.

View djyadav's full-sized avatar

Deepak djyadav

View GitHub Profile
"remark": "^15.0.1",
"remark-html": "^16.0.1",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
import React, { useState, useEffect } from 'react';
import { remark } from 'remark';
import remarkParse from 'remark-parse';
/*
* This decorates Handlebars.js with the ability to load
* templates from an external source, with light caching.
*
* To render a template, pass a closure that will receive the
* template as a function parameter, eg,
* T.render('templateName', function(t) {
* $('#somediv').html( t() );
* });
* Source: https://github.com/wycats/handlebars.js/issues/82