1.1.1 • Published 9 years ago

@aftonbladet/stylizr v1.1.1

Weekly downloads
253
License
UNLICENSED
Repository
github
Last release
9 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

9 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago