1.0.8 • Published 4 years ago

gpcoders-render-component v1.0.8

Weekly downloads
28
License
ISC
Repository
github
Last release
4 years ago

Project Title

One Paragraph of project description goes here

Installing

npm users

npm i gpcoders-render-component

or yarn users

yarn add gpcoders-render-component

Use

Will check the loader state and then it will load the component

import GPRenderComponent from 'gpcoders-render-component'

const DummyData = (props) => {
    const { data } = props
}

const App = () => {
    return (
        <>
            <h1>Hello React</h1>
            // Spinner bool or data can be in any form
            <GPRenderComponent component={DummyData} spinner={true} data={data} />
        </>
    )
}

With custom loader

Can be used any React component as loader

import GPRenderComponent from 'gpcoders-render-component'

const CustomLoader = () => {
    return (
        <div>loading...</div>
    )
}

const DummyData = (props) => {
    const { data } = props
}

const App = () => {
    return (
        <>
            <h1>Hello React</h1>
            // Spinner bool or data can be in any form
            <GPRenderComponent spinner={true} data={data} customSpinner={<CustomLoader />} />
        </>
    )
}

GPRenderComponent Props

NameTypeDefaultDescrption
componentComponentErrorComponentexample: Home, Profile
spinnerbooleanfalseLoader will wait for the component loading
customSpinnerelementnullPass custom spinner
dataanynullCan be Array, Object etc
By: GPCODERS
website: https://www.gpcoders.com
copyright 2020 @gpcoders
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago