1.1.1 • Published 7 years ago

@aftonbladet/stylizr v1.1.1

Weekly downloads
253
License
UNLICENSED
Repository
github
Last release
7 years ago

stylizr

Takes a text and a styles-array and converts it by calling the handlers supplied when creating a stylizr instance.

Usage

// stylizr-instance.js
import React from 'react';
import stylizr from 'stylizr';

const stylizrInstance = stylizr({
    'style:em': (text, key) => <em key={key}>{text}</em> 
});

export default stylizrInstance;

// ---- 

// another-file.js
import React from 'react';
import ReactDOM from 'react-dom';
import stylizr from './stylizr-instance';

ReactDOM.render(
    <MyComponent>{
        stylizr('This is my text', [{
            offset: 5, 
            length: 2, 
            type: 'style:em'
        }])
    }</MyComponent>,
    document.getElementById('react-root')
);
1.1.1

7 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago