esl-pro-web-components
TypeScript icon, indicating that this package has built-in type declarations

0.0.18 • Public • Published

esl-pro-web-components

Localhost testing

Simply run npm install and npm run dev

React Create App:

Import the library in your index file like this:

import 'esl-pro-web-components'
import {WorldRankingProps} from 'esl-pro-web-components'

declare global {
       namespace JSX {
               interface IntrinsicElements {
                       'world-ranking': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & WorldRankingProps
               }
       }
}

const Component = () => {
    return <world-ranking />
}

NextJS:

As you do not have access to document or window in NextJS, you will have to import the module using lazy import inside useEffect hook:

import {WorldRankingProps} from 'esl-pro-web-components'

declare global {
       namespace JSX {
               interface IntrinsicElements {
                       'world-ranking': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & WorldRankingProps
               }
       }
}

const Component = () => {
    useEffect(() => {
            import('esl-pro-web-components')
    }, [])

    return <world-ranking />
}

With theming

const Component = () => {
    useEffect(() => {
            import('esl-pro-web-components')
    }, [])

    return <world-ranking
				ref={(ref: HTMLElement & WorldRankingProps | null) => {
                    if (!ref) {
                        return
                    }
					ref.theme = {
						container: {
							backgroundColor: 'blue',
						},
					}
				}}
			/>
}

Readme

Keywords

none

Package Sidebar

Install

npm i esl-pro-web-components

Weekly Downloads

1

Version

0.0.18

License

none

Unpacked Size

57.4 kB

Total Files

9

Last publish

Collaborators

  • breno.prata