ReactJS - Passing values from one component to other components using props

If there is components hierarchy in which top level component is rendering child component, sometimes we would need to pass the value from parent component to child component. This can be done using props which is already available variable in component.

In each component, there is props object which holds data/properties passed to this component object at the time of creation. After component gets created, this associated property object props of that component could not be updated. So, props is read-only object in component. 

Tags

ReactJS - Rendering list or array of elements

Example to render list of items using components. How to generate ul li from array or list in ReactJS or JavaScript Here, many time we will get lists of item from database or api or other sources and we would have to display these values in either list view or in tabular form. In javascript we have many approached but this approach looks better to wrap each item from array or list in html tag without writing much of code.

Tags

Drupal 7 - Creating block programmatically

Drupal blocks are the reusable content holder that can be placed anywhere in the region of the page. You can manage them and their configuration from the Structure area of the Drupal back-end. Each theme defines certain sections in their page where you can assign the block to them. 

Although, Drupal developer can use the Drupal admin area to manage and create the block, but there is another way to create them as well. You can create the block by doing the coding yourself. This feature of drupal allows you to add the display component to website bases on your programming logic.

Tags