React-Crouton A Message Component for Reactjs
A message component for reactjs
Install via npm
npm i react-crouton --save-dev
var Crouton = require('react-crouton')
var data = {
id: Date.now(),
type: 'error',
message: 'Hello React-Crouton',
autoMiss: true || false,
onDismiss: listener,
buttons: [{
name: 'close',
listener: function() {
}
}],
hidden: false,
timeout: 2000
}
<Crouton
id={data.id}
type={data.type}
message={data.message}
onDismiss={data.onDismiss}
buttons={data.buttons}
hidden={data.hidden}
timeout={data.timeout}
autoMiss={data.autoMiss}>
// You can render child component here
// <ChildComponent />
</Crouton>
id required, every message need an unique id.
type: number
message required, the message what you want show.
type: string
|| array
example:
message: 'Hello React-Crouton'
message: ['Hello', 'React', '-', 'Crouton']
type required, define what type message you want to define.
type: string
hidden optional, control this property to show or hidden crouton.
type: boolean
, default is false
buttons optional, define the buttons that you want show to the user.
type: string
|| array
example:
buttons: 'close'
butons: [{
name: 'close'
}]
butons: [{
name: 'close',
listener: function() {
console.log('close button clicked.')
}
}]
butons: [{
name: 'close',
className: 'custom class name',
listener: function() {
console.log('close button clicked.')
}
}]
autoMiss optional, crouton will auto missed if set this propterty, default is true.
type: boolean
timeout optional, set how long (ms) to auto dismiss the crouton.
type: number
, default is 2000
ms (2 seconds)
onDismiss optional, crouton will invoke this listener when it dismissed.
type: function
Author: xeodou
Demo: https://xeodou.github.io/react-crouton/
Source Code: https://github.com/xeodou/react-crouton
Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.
Increase Performance of React Applications Via Array JavaScript Methods. We will create a simple event management application in the react to add, update, and delete an event.
I have been using React JS in my projects for quite some time now and am used to managing routing in my app using the react-router package. I have always been keen on having as little dependencies in my apps as possible, so, I always felt perturbed by the use of this particular package in simpler apps which did not have complex routes.
In this post, I will share my own point of view about React Hooks, and as the title of this post implies, I am not a big fan.
This article will walk you through the concepts you would need to know to step into the world of widely used ReactJS.