Posts

handle dynamic input field

Image
Handle multiple and dynamic input fields We'll  learn here, How to create a Multiple   Input fields handler . Let's start, Note  :  You can clone this app from GitHub   click me to get link   1. We create a  React App . npx create-react-app multiple-input-fields cd multiple-input-fields 2. App.js file import React from "react" ; import Input from "./input" ; import "./App.css" ; export default function App () { const [ result , setResult ] = React . useState ( 0 ); const [ arr , setArr ] = React . useState ( 2 ); const [ inputData , setInputData ] = React . useState ({}); const NextField = () => { if ( arr < 10 ) { setArr ( arr + 1 ); } else { alert ( "Sorry, You have exceeded the limits of input fields           \n Not allowed more than 10 input fields" ); } }; const vals = Object . values ( inputData ); const handleClick = () => { ...

Custom React Text Editor

Image
 Custom React Text Editor  We'll  learn here, How to create a Custom Text Editor on React JS. Let's start, Note : You can clone this app from GitHub   click me to get link   1. We create a React App . run: npx create-react-app custom-text-editor cd custom-text-editor 2. App.js file import React from "react" ; import "bootstrap/dist/css/bootstrap.min.css" ; import { BsTextCenter , BsTextRight , BsTextLeft } from "react-icons/bs" ; import { IoIosColorPalette } from "react-icons/io" ; import { Arr } from "./constants/colors" ; import { fontSize } from "./constants/font-sizes" ; import { fontWeight } from "./constants/font-Weights" ; export default function App () { const [ isSelected , setIsSelected ] = React . useState ( "" ); const [ fontSizes , setFontSizes ] = React . useState ( 11 ); const [ fontWeights , setFontWeights ] = React . useState ( 400 ); const [ active , s...