منگل، 16 اگست، 2016

In this tutorial we will show you how to combine components to make the app easier to maintain. This approach will allow you to update and change your components without affecting the rest of the page. Stateless Example Our first component in example below isApp. This component is owner ofHeaderandContent. We are creatingHeaderandContentseparately and just adding it inside JSX tree in ourAppcomponent. OnlyAppcomponent needs to be exported. App.jsx importReactfrom'react';classAppextendsReact.Component{ render(){return(
);}}classHeaderextendsReact.Component{ render(){return(

Header

);}}classContentextendsReact.Component{ render(){return(

Content

The content text!!!

);}}exportdefaultApp; To be able to render this on page, we need to import it inmain.jsfile and callreactDOM.render(). We already did it when we were setting environment. main.js importReactfrom'react';importReactDOMfrom'react-dom';importAppfrom'./App.jsx';ReactDOM.render(, document.getElementById('app')); Above code will generate following result: Stateful Example In this example we will set the state for owner component (App). TheHeadercomponent is just added like in the last example since it doesn't need any state. Instead of content tag, we are creatingtableandtbodyelements where we will dynamically insertTableRowfor every object from thedataarray. You can see that we are using EcmaScript 2015 arrow syntax (⇒) which looks much cleaner then the old JavaScript syntax. This will help us create our elements with fewer lines of code. It is especially useful when you need to create list with a lot of items. App.jsx importReactfrom'react';classAppextendsReact.Component{ constructor(){super();this.state ={ data:[{"id":1,"name":"Foo","age":"20"},{"id":2,"name":"Bar","age":"30"},{"id":3,"name":"Baz","age":"40"}]}} render(){return(
{this.state.data.map((person, i)⇒)}
);}}classHeaderextendsReact.Component{ render(){return(

Header

);}}classTableRowextendsReact.Component{ render(){return({this.props.data.id}{this.props.data.name}{this.props.data.age});}}exportdefaultApp; main.js importReactfrom'react';importReactDOMfrom'react-dom';importAppfrom'./App.jsx';ReactDOM.render(, document.getElementById('app')); NOTE Notice that we are usingkey = {i}insidemap()function. This will help React to update only necessary elements instead of re-rendering entire list when something change. It is huge performance boost for larger number of dynamically created


React uses JSX for templating instead of regular JavaScript. It is not necessary to use it, but there are some pros that comes with it. JSX is faster because it performs optimization while compiling code to JavaScript. It is also type-safe and most of the errors can be caught during compilation. JSX makes it easier and faster to write templates if you are familiar with HTML. Using JSX JSX looks like regular HTML in most cases. We already used it in environment setup tutorial. Look at the code fromApp.jsxwhere we are returningdiv. App.jsx importReactfrom'react';classAppextendsReact.Component{ render(){return(
HelloWorld!!!
);}}exportdefaultApp; Even though it's similar to HTML, there are a couple of things you need to keep in mind when working with JSX. Nested Elements If you want to return more elements, you need to wrap it with one container element. Notice how we are usingdivas a wrapper forh1,h2andpelements. App.jsx importReactfrom'react';classAppextendsReact.Component{ render(){return(

Header

Content

Thisis the content!!!

);}}exportdefaultApp; Attributes You can use your own custom attributes in addition to regular HTML properties and attributes. When you want to add custom attribute, you need to usedata-prefix. In example below we addeddata-myattributeas an attribute ofpelement. importReactfrom'react';classAppextendsReact.Component{ render(){return(

Header

Content

Thisis the content!!!

);}}exportdefaultApp; JavaScript Expressions JavaScript expressions can be used inside of JSX. You just need to wrap it with curly brackets{}. Example below will render2. importReactfrom'react';classAppextendsReact.Component{ render(){return(

{1+1}

);}}exportdefaultApp; You can not useif elsestatements inside JSX but you can useconditional (ternary)expressions instead. In example below variableiequals to1so the browser will rendertrue, if we change it to some other value it will renderfalse. importReactfrom'react';classAppextendsReact.Component{ render(){var i =1;return(

{i ==1?'True!':'False'}

);}}exportdefaultApp; Styling React recommends using inline styles. When you want to set inline styles, you need to usecamelCasesyntax. React will also automatically appendpxafter the number value on specific elements. You can see below how to addmyStyleinline toh1element. importReactfrom'react';classAppextendsReact.Component{ render(){var myStyle ={ fontSize:100, color:'#FF0000'}return(

Header

);}}exportdefaultApp; Comments When writing comments you need to put curly brackets{}when you want to write comment within children section of a tag. It is good practice to always use{}when writing comments since you want to be consistent when writing the app. importReactfrom'react';classAppextendsReact.Component{ render(){return(

Header

{//End of the line Comment...}{/*Multi line comment...*/}
);}}exportdefaultApp


We already stated that ReactJS is JavaScript library used for building reusable UI components. Definition can be found on React official documentation − React is a library for building composable user interfaces. It encourages the creation of reusable UI components which present data that changes over time. Lots of people use React as the V in MVC. React abstracts away the DOM from you, giving a simpler programming model and better performance. React can also render on the server using Node, and it can power native apps using React Native. React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding. React Features JSX− JSX is JavaScript syntax extension. It isn't necessary to use JSX in React development, but it is recommended. Components− React is all about components. You need to think of everything as a component. This will help you to maintain the code when working on larger scale projects. Unidirectional data flow and Flux− React implements one way data flow which makes it easy to reason about your app. Flux is a pattern that helps keeping your data unidirectional. License− React is licensed under the Facebook Inc. Documentation is licensed under CC BY 4.0. React Advantages React uses virtual DOM which is JavaScript object. This will improve apps performance since JavaScript virtual DOM is faster than the regular DOM. React can be used on client and server side. Component and Data patterns improve readability which helps to maintain larger apps. React can be used with other frameworks. React Limitations React only covers view layer of the app so you still need to choose other technologies to get a complete tooling set for development. React is using inline templating and JSX. This can seem awkward to some developers.


پیر، 15 اگست، 2016

follow waqqas51214 send to 40404


Twitter has a great paid ads option which is very effective for acquiring followers, but in this article we’ll only consider free options (since the paid one is pretty obvious). Don’t forget to add your best Twitter tips in the comments at the end of this post! 1.Follow more people. Researchshows a correlation between the number of people followed and the number of followers. 2.Use a tool like Hootsuiteor SproutSocialto schedule your tweets. Posting regularly will increase your engagement and visibility, thereby increasing your follower count. Recommended by Forbes 3.Use Twiendsto find new Twitter users you can connect with. Once you’re listed on the platform, other users with similar interests will also be able to find and follow you. 4.Optimize your Twitter bio. Users who want to find out more about you will inevitably visit your Twitter bio. Make sure it’s professional, complete and that it does a great job of representing you and your business. 5.Use links in your tweets. Tweets with links get more retweets than those without


اتوار، 14 اگست، 2016

Here’s exactly how to make money from your blog: 1.Write content that gets lots of traffic 2.Convert visitors into email subscribers 3.Send those subscribers content that builds trust 4.Sell products or services your audience wants That’s it. Four steps. The problem? It’s freaking hard to do. The process is simple on the surface, but each step is enormously complicated and requires extraordinary skill. Especially the last one. For instance, do you want to sell your own products or services? If so, which ones? Here are just a few of the options: Make money blogging by selling these types of things Or… what if you don’t have any products and services to sell? What should you do then? Well, you can also make money blogging by sellingsomeone else’sproducts and services. The most conventional (and least profitable) method is selling advertising, where you allow companies to promote their products and services to your audience in exchange for a fee. You can also form partnerships with other companies, promoting their products and services as an “affiliate” and earning a commission each time one of your readers purchases. Which model should you choose? What should you do? It’s up to you to decide, but before making your decision, there’s one crucial lesson you need to understand


This is a free and comprehensive report about facebook.com. facebook.com is hosted in Menlo Park CA, United States on a server with an IP address of 173.252.120.68. The local currency for Menlo Park CA, United States is USD ($). The website facebook.com is expected to be earning an estimated $5,466,756 USD on a daily basis. If facebook.com was to be sold it would possibly be worth $1,995,365,829 USD (based on the daily revenue potential of the website over a 12 month period). According to our google pagerank analysis, the url facebook.com currently has a pagerank of 0/10. Our records indicate that facebook.com receives an estimated 520,643,397 unique visitors each day - an unbelievable amount of traffic! facebook.com information and statisticsWebsite / Domain: facebook.com Website IP: 173.252.120.68 Hosting Location:Menlo Park CA, United StatesLocal Currency: USD ($)Alexa Rank: 3Google Index: View facebook.com Google LinksYahoo Index: View facebook.com Yahoo LinksBing Index: View facebook.com Bing LinksHistory: View facebook.com on WayBackMachine facebook.com traffic and earningsPurchase/Sale Value: $1,995,365,829 USD Daily Revenue:$5,466,756 USD Monthly Revenue:$166,390,822 USD Yearly Revenue:$1,995,365,819 USDDaily Unique Visitors: 520,643,397Monthly Unique Visitors: 15,846,744,926Yearly Unique Visitors: 190,034,839,905