SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
Reactjs,Redux,AntD and Umi js
By:Isuru Samaraweera
Agenda
● Introduction to Reactjs and Ant Design
● Key constituents of ReactJs
● Introduction to Redux
● State management with Redux
– Actions
– Reducers
– Effects,Generators
● Umi js as a UI framework
What is ReactJs
● API to develop User Interfaces
– View on MVC
– One way binding
– Reusable components
– Responsive
– React js vs React native
● Client base
– Facebook,Microsoft
– Netflix,Uber
– Espn,Wallmart
– BBC,Atalassian and more
Ant Design● Ant Design
– An Enterprise-class UI design language
– https://ant.design/
● Ant Design of React
– UI components out of the box, based on React.
– http://react-component.github.io/badgeboard/
● Ant Design Pro
– An out-of-box UI solution for enterprise applications
– Umijs(react,redux dva,jest,mockapi)+antD react components
– https://pro.ant.design/
● Ant Design Mobile
– Mobile UI specification and React implementation.
– https://mobile.ant.design/
Main React constituents
● Virtual Dom
● JSX
● Props/PropTypes
● States
● LifeCycle
Virtual Dom
●
●
JSX
● Write code that looks like HTML
●
●
● Make large trees easier to read
● JSX Preprocessor
– converts JSX to javascript
● Babel
– a transpiler that turns code to be compatible with
older browser
● Webpack
– Build tool/Auto refresh/Bundler
Props,proptypes and state
● Props
– pass parameters from parents to children components
● static propTypes = {
incrementBy: PropTypes.number,
};
– Bool,number,string,func,array etc
● <Hello incrementBy={1}/>
– this.props.incrementBy
– Props are immutable
● State
– To manage state I e respond to user input
– SetState to update currentstate to next state
– Rerender on state change
Reactjs Life cycle
● 2 Major types
– Will methods—Called right before something
happens
– Did methods—Called right after something happens
● Based on phase of life cycle
– Initialization—When a component class is being
instantiated.
– Mounting—A component is being inserted into the
DOM.
– Updating—A component is being updated with new
data via state or props.
– Unmounting—A component is being removed from
the DOM.
componentwillreceiveprops
<Component value={15} />
Redux
● Provide State management layer for React.
● Store
– Holds all application state in a single state tree
– Updated only with actions
– An object describing an event.
● Reducers to transform application state
Actions and reducers
● Javascript obect representing event
{type: 'CREATE_POST',
payload: {
body: 'This is body'
}}
●
Connect to redux store
● import { connect } from 'react-redux';
● class App extends Component {
● render() {
● return (
● <div className="main-content">
● <TasksPage tasks={this.props.tasks} />
● </div>);}}
● function mapStateToProps(state) {
● return {tasks: state.tasks}}
● export default connect(mapStateToProps)(App);
Asynchronous calls
Generators
● Functions
– Can be paused and resumed
– Handle complex async events efficiently
– Prevent call back hell
● function* count() {
● yield 1;
● yield 2;
● yield 3;
● }
● Const iterator = count()
● Iteraor.next()=>{ value: 1, done: false }
● Iteraor.next()=>{ value: 2, done: false }
● Iteraor.next()=>{ value: 3, done: false }
● Iteraor.next()=>{ value: undefined, done: true }
Redux Saga Effects
● function* fetchTasks() {
● try {
● const { data } = yield call(api.fetchTasks);
● yield put({
● type: 'FETCH_TASKS_SUCCEEDED',
● payload: { tasks: data },
● });
● } catch (e) {
● yield put({
● type: 'FETCH_TASKS_FAILED',
● payload: { error: e.message },
● });}}
Umi js Dva based State
management
● Sessionstorage
● Localstorage
React Redux AntD and Umi js

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Continuous Delivery of Agile Architecture
Continuous Delivery of Agile ArchitectureContinuous Delivery of Agile Architecture
Continuous Delivery of Agile Architecture
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
 
Visual Design
Visual DesignVisual Design
Visual Design
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
 
Intégration de SonarQube dans GitLab ci
Intégration de SonarQube dans GitLab ciIntégration de SonarQube dans GitLab ci
Intégration de SonarQube dans GitLab ci
 
PerfUG : présentation de Dynatrace APM
PerfUG : présentation de Dynatrace APMPerfUG : présentation de Dynatrace APM
PerfUG : présentation de Dynatrace APM
 
Terraform
TerraformTerraform
Terraform
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
Swagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdfSwagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdf
 
Event storming
Event storming Event storming
Event storming
 
CQRS and Event Sourcing
CQRS and Event Sourcing CQRS and Event Sourcing
CQRS and Event Sourcing
 
Using Angular JS in APEX
Using Angular JS in APEXUsing Angular JS in APEX
Using Angular JS in APEX
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Deep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm ModeDeep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm Mode
 
Best Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformBest Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with Terraform
 
Terraform
TerraformTerraform
Terraform
 
Clean architecture with ddd layering in php
Clean architecture with ddd layering in phpClean architecture with ddd layering in php
Clean architecture with ddd layering in php
 
Continuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and HelmContinuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and Helm
 

Semelhante a React Redux AntD and Umi js

Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"
Flipkart
 

Semelhante a React Redux AntD and Umi js (20)

Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and redux
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
Introduction to Redux.pptx
Introduction to Redux.pptxIntroduction to Redux.pptx
Introduction to Redux.pptx
 
React js
React jsReact js
React js
 
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
 
Reactjs
Reactjs Reactjs
Reactjs
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
How to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptxHow to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptx
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
Content-Driven Apps with React
Content-Driven Apps with ReactContent-Driven Apps with React
Content-Driven Apps with React
 
Let's start with REDUX
Let's start with REDUXLet's start with REDUX
Let's start with REDUX
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5
 
Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"
 

Mais de Isuru Samaraweera (6)

Full Text Search in Couchbase
Full Text Search in CouchbaseFull Text Search in Couchbase
Full Text Search in Couchbase
 
Web security and OWASP
Web security and OWASPWeb security and OWASP
Web security and OWASP
 
Exploring Streams and Lambdas in Java8
Exploring Streams and Lambdas in Java8Exploring Streams and Lambdas in Java8
Exploring Streams and Lambdas in Java8
 
Java8lambda
Java8lambda Java8lambda
Java8lambda
 
Groovy unleashed
Groovy unleashed Groovy unleashed
Groovy unleashed
 
Introductionto fp with groovy
Introductionto fp with groovyIntroductionto fp with groovy
Introductionto fp with groovy
 

Último

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 

Último (20)

(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

React Redux AntD and Umi js

  • 1. Reactjs,Redux,AntD and Umi js By:Isuru Samaraweera
  • 2. Agenda ● Introduction to Reactjs and Ant Design ● Key constituents of ReactJs ● Introduction to Redux ● State management with Redux – Actions – Reducers – Effects,Generators ● Umi js as a UI framework
  • 3. What is ReactJs ● API to develop User Interfaces – View on MVC – One way binding – Reusable components – Responsive – React js vs React native ● Client base – Facebook,Microsoft – Netflix,Uber – Espn,Wallmart – BBC,Atalassian and more
  • 4. Ant Design● Ant Design – An Enterprise-class UI design language – https://ant.design/ ● Ant Design of React – UI components out of the box, based on React. – http://react-component.github.io/badgeboard/ ● Ant Design Pro – An out-of-box UI solution for enterprise applications – Umijs(react,redux dva,jest,mockapi)+antD react components – https://pro.ant.design/ ● Ant Design Mobile – Mobile UI specification and React implementation. – https://mobile.ant.design/
  • 5. Main React constituents ● Virtual Dom ● JSX ● Props/PropTypes ● States ● LifeCycle
  • 7. JSX ● Write code that looks like HTML ● ● ● Make large trees easier to read ● JSX Preprocessor – converts JSX to javascript ● Babel – a transpiler that turns code to be compatible with older browser ● Webpack – Build tool/Auto refresh/Bundler
  • 8. Props,proptypes and state ● Props – pass parameters from parents to children components ● static propTypes = { incrementBy: PropTypes.number, }; – Bool,number,string,func,array etc ● <Hello incrementBy={1}/> – this.props.incrementBy – Props are immutable ● State – To manage state I e respond to user input – SetState to update currentstate to next state – Rerender on state change
  • 9. Reactjs Life cycle ● 2 Major types – Will methods—Called right before something happens – Did methods—Called right after something happens ● Based on phase of life cycle – Initialization—When a component class is being instantiated. – Mounting—A component is being inserted into the DOM. – Updating—A component is being updated with new data via state or props. – Unmounting—A component is being removed from the DOM.
  • 10.
  • 12. Redux ● Provide State management layer for React. ● Store – Holds all application state in a single state tree – Updated only with actions – An object describing an event. ● Reducers to transform application state
  • 13. Actions and reducers ● Javascript obect representing event {type: 'CREATE_POST', payload: { body: 'This is body' }} ●
  • 14. Connect to redux store ● import { connect } from 'react-redux'; ● class App extends Component { ● render() { ● return ( ● <div className="main-content"> ● <TasksPage tasks={this.props.tasks} /> ● </div>);}} ● function mapStateToProps(state) { ● return {tasks: state.tasks}} ● export default connect(mapStateToProps)(App);
  • 16. Generators ● Functions – Can be paused and resumed – Handle complex async events efficiently – Prevent call back hell ● function* count() { ● yield 1; ● yield 2; ● yield 3; ● } ● Const iterator = count() ● Iteraor.next()=>{ value: 1, done: false } ● Iteraor.next()=>{ value: 2, done: false } ● Iteraor.next()=>{ value: 3, done: false } ● Iteraor.next()=>{ value: undefined, done: true }
  • 18. ● function* fetchTasks() { ● try { ● const { data } = yield call(api.fetchTasks); ● yield put({ ● type: 'FETCH_TASKS_SUCCEEDED', ● payload: { tasks: data }, ● }); ● } catch (e) { ● yield put({ ● type: 'FETCH_TASKS_FAILED', ● payload: { error: e.message }, ● });}}
  • 19. Umi js Dva based State management ● Sessionstorage ● Localstorage