create-markup

Create a dangerouslySetInnerHTML object for React.

Usage no npm install needed!

<script type="module">
  import createMarkup from 'https://cdn.skypack.dev/create-markup';
</script>

README

create-markup

Build Status

Create a new object containing only the key __html and your string data as the value.

Installation

npm install create-markup --save

Usage

import createMarkup from 'create-markup';
const markup = createMarkup('hello'); // {__html:'hello'}
<div dangerouslySetInnerHTML={markup} />

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Release History

  • 1.0.0 Initial release