Sunday, 24 March 2019

In this Article, we will learn How to implement server-side paging in ASP.NET MVC. Pagination is used to divide the data or content into multiple pages which makes a page to load faster and the user can read the data without scrolling.

In React (or React Native), there are two types of data that can control a component. One is State and another is Props.

State: State can be referred as the local state of the component. State of a component cannot be accessed and modified outside of the component. State is mutable, which means that the state of a component can be changed in response to some action. State of one component can behave as Props for the other component as well. We cannot update the state directly, in order to update the state of the component, we have to use setState method. setState will re-render the parent component as well as the child component class.

Let’s see How we can use state in React Native Application.App.js Code:

import React from'react';

import { StyleSheet, Text, View } from'react-native';

exportdefaultclassAppextendsReact.Component {

state = {

Counter: 1

}

updateState = () =>

this.setState({ Counter: this.state.Counter + 1 })

render() {

return (

<View style={styles.container}>

<Text style={{ fontSize: 40 }}>State Example</Text>

<Text style={{ fontSize: 40 }} onPress={this.updateState}>

{this.state.Counter}

</Text>

</View>

);

}

}

const styles = StyleSheet.create({

container: {

flex: 1,

backgroundColor: '#fff',

alignItems: 'center',

justifyContent: 'center',

},

});

In the above example, we have created state object and added a Counter property with initial value as 1. We have declared updateState function in order to update the state using the setState method. On calling setState, it will re-render the Component. On the Text component, we are using onPress Touch event which will can the updateState function and increase the counter value with 1. Now let’s run the application with npm Start command.Preview:

Props: Props stands for the properties and used to pass data as well as an event handler to the child components (passing data from the view to the controller or from parent to the child). It is immutable that means we cannot change its value and have fast performance than the state. Let’s do some changes in the previous example in order to check its functionality. In order to demonstrate we need two Classes, one will behave as parent and other will behave as child.App.js

In the above code, we are importing the Child class (code for the Child class is provided below) and passed Counter value(as myCounter attribute in JSX) as well as function (as updateState atribute) for the updating the State as props.ChildApp.js:

import React from'react';

import { StyleSheet, Text, View } from'react-native';

exportdefaultclassChildextendsReact.Component {

render() {

return (

<View style={styles.container}>

<Text style={{ fontSize: 40 }}>Props Example</Text>

<Text style={{ fontSize: 40 }} onPress={this.props.updateState}>

{this.props.myCounter}

</Text>

</View>

);

}

}

const styles = StyleSheet.create({

container: {

flex: 1,

backgroundColor: '#fff',

alignItems: 'center',

justifyContent: 'center',

},

});

As we know, our Child class is receiving multiple props so we can use this.props.<Name_Of_Property> in order to access its value.Preview:

Tuesday, 18 December 2018

In this Article, we will learn How to create the first application using React Native. We can create native mobile apps using JavaScript and React. It uses React in order to create rich mobile UI interfaces. As Stated on the React Native official Website,

“With React Native, you don’t build a “mobile web app”, an “HTML 5 app” or a “Hybrid App”. You build a real mobile app that’s indistinguishable from the app developed using Java or Objective-C. Native use the same fundamental blocks as in IOS and Android.”

Tuesday, 27 November 2018

MailsDaddy NSF to PST Converter is a most desirable tool used to convert IBM Lotus Notes emails, contacts, calendar events, To-do lists, notes etc into Outlook PST format. It is a one-stop conversion solution of MailsDaddy Software and a powerful tool which performs a migration process of NSF to PST flawlessly and accurately. It extracts all the Lotus Notes information and exports it in Outlook compatible PST format.