1.0.1 • Published 4 years ago

@bast1oncz/robots v1.0.1

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
4 years ago

@bast1oncz/robots

About

Solves problem with crawlers indexing react application. The provider contains basic settings, which can be overriden inside wrapped components using react hook api. It is highly recommended using this library along with some application router. Does not help robots indexing the application by generating any additional html.

Usage

Installation

    npm install @bast1oncz/robots

Setup

    import {RobotsProvider} from '@bast1oncz/robots'

    <RobotsProvider defaultSettings={{index: true, follow: true}}>
        {children}
    </RobotsProvider

Override default settings inside component

    import {useRobotRestriction} from '@bast1oncz/robots'

    // disables robot index
    useRobotRestriction('index')

    // disables robot follow
    useRobotRestriction('follow')