0.0.18 • Published 7 months ago

esl-pro-web-components v0.0.18

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

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',
						},
					}
				}}
			/>
}
0.0.18

7 months ago

0.0.17

7 months ago

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago