项目作者: rupeshpadhye

项目描述 :
Demo Project which shows Power of React Context API
高级语言: TypeScript
项目地址: git://github.com/rupeshpadhye/add-bidder-demo.git
创建时间: 2020-05-16T10:38:08Z
项目社区:https://github.com/rupeshpadhye/add-bidder-demo

开源协议:

下载


Add Bidder Demo

Demonstrates the React Hooks API and Context API usage
This is demo client side add bidder library , client can consume this library to show
adds on there sites

Local Development

Local development is broken into two parts (ideally using two tabs).

First, run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes.

  1. yarn start # runs rollup with watch flag

The second part will be running the example/ create-react-app that’s linked to the local version of your module.

  1. # (in another tab)
  2. cd example
  3. yarn start # runs create-react-app dev server
Example

Demo Example

Library Install

  1. npm install --save add-bidder

Library Usage

  1. import React, { Component } from 'react'
  2. import { AddProvider, Add } from 'add-bidder';
  3. import 'add-bidder/dist/index.css'
  4. class App extends Component {
  5. render() {
  6. return (
  7. <AddProvider clientId="client-233434">
  8. <Add size="banner"></Add>
  9. </AddProvider>
  10. )
  11. }
  12. }

Boilerplate Code

create-react-library