Coder Social home page Coder Social logo

bstudyreact's Introduction

redux和react-redux 区别?

01 依赖: react-redux依赖redux
02 react-redux 好处01: 把有状态组件变成无状态组件
02 react-redux 好处02: 拆分方法,对于大型项目复用性越高

react-redux

01 安装: npm i -S react-redux

step1: 提供器 provider

00 引入位置: 入口文件index.js
01 引入:

  import {Provider} from 'react-redux'
  import store from './store'
  <Provider store={store}></Provider>

02 只要被包裹就可以访问 store<br>
03 包裹要使用的组件

step2: 连接器 connect

00 引入位置: 组件中 02 映射: 把state 映射出props属性

派发action

react-router 路由

01 安装: npm i -S react-router-dom
02 路由: 也是无状态组件
03 BrowerRouter: 路由器
04 Route: 线路
05 Link: 跳转
06 ReactRouter精确匹配和页面分离: exact 精确匹配

react-router 路由-动态传值

01 动态传值定义: /list/:id

react-router 路由重定向redirect

01 基本跳转和重定向区别: 重定向不可前进后退 02 编程式重定向: this.props.history.push('/home')

redirect-router 嵌套路由

01 什么是嵌套路由: 一级二级路由(中台系统)

后台动态获取路由进行配置

01 方案: 遍历

bstudyreact's People

Contributors

msabby avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.