From 289ef9991b796eeaa45372a27e980083da6a2b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Svein=20Petter=20Gj=C3=B8by?= Date: Sat, 6 Oct 2018 23:24:42 +0200 Subject: [PATCH] #1031 Added metadata to provider markdown and updated the sidebar (#1034) Added missing markdown document to sidebar and updated it's structure. --- docs/api/Provider.md | 30 +++++++++++++++++------------- website/sidebars.json | 4 +++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/api/Provider.md b/docs/api/Provider.md index 2d14a6dab..ea5d33df8 100644 --- a/docs/api/Provider.md +++ b/docs/api/Provider.md @@ -1,8 +1,14 @@ +--- +id: provider +title: Provider +sidebar_label: Provider +--- + # `` ## Overview -The `` makes the Redux `store` available to any nested components that have been wrapped in the `connect()` function. +The `` makes the Redux `store` available to any nested components that have been wrapped in the `connect()` function. Since any React component in a React-Redux app can be connected, most applications will render a `` at the top level, with the entire app’s component tree inside of it. @@ -15,26 +21,26 @@ Note: If you really need to, you can manually pass `store` as a prop to a connec `store` (Redux Store) The single Redux `store` in your application. -`children` (ReactElement) -The root of your component hierarchy. +`children` (ReactElement) +The root of your component hierarchy. ### Example Usage -In the example below, the `` component is our root-level component. This means it’s at the very top of our component hierarchy. +In the example below, the `` component is our root-level component. This means it’s at the very top of our component hierarchy. -**Vanilla React Example** +**Vanilla React Example** ```js import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; - + import { App } from './App'; import createStore from './createReduxStore'; - + const store = createStore(); - + ReactDOM.render( @@ -51,14 +57,14 @@ In the example below, the `` component is our root-level component. This import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { Router, Route } from 'react-router-dom'; - + import { App } from './App'; import { Foo } from './Foo'; import { Bar } from './Bar'; import createStore from './createReduxStore'; - + const store = createStore(); - + ReactDOM.render( @@ -71,5 +77,3 @@ In the example below, the `` component is our root-level component. This document.getElementById('root') ) ``` - - diff --git a/website/sidebars.json b/website/sidebars.json index bee6b9ac6..371ac498e 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -1,5 +1,7 @@ { "docs": { - "Docs": ["getting-started", "api", "troubleshooting"] + "Introduction": ["getting-started"], + "API Reference": ["api", "api/provider"], + "Guides": ["troubleshooting"] } }