#Jquery to Angular to React Transition https://medium.com/hoopeez/the-deep-dive-transitioning-to-react-5917eda01ebf ost React applications are modeled on Flux design pattern). React is mostly the V in MVC. Since it is a library, you can include it in applications built using other technologies.
#Babel JSX is rewritten to JavaScript. This can be done with babel or webpack internals.
Babel is used to transpile the JavaScript code, making it compatible with older browsers, while Webpack is used to bundle and optimize the code.
Class components older version of React Functional component in new version curent version Teact v18.3 use Function components along with Hooks, which were added in React 16.8. React 19 beta has support for custom Elements
#With introduction to the React 16, writing functional components is the standard way of creating components in modern react applications. https://blog.weareredlight.com/the-rise-of-functional-components-react-v16-7-0-now-with-hooks-90cac72b8ab7?gi=27c595b1ced0
This project was bootstrapped with Create React App.
npx create-react-app my-app --template typescript
https://builtin.com/software-engineering-perspectives/create-react-app-typescript
https://react.dev/learn/typescript
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
npx create-react-app my-app --template typescript https://create-react-app.dev/docs/adding-typescript/ https://react.dev/learn/typescript
React Hook "useEffect" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function react-hooks/rules-of-hooks
in React: initialValue={'My Initial Value'}
in Angular: initial-value="My Initial Value"
In Angular, variable properties use camelCase or kebab-case [initalValue]="myVariable" should work
In Angular, use camelCase when it's a complex variable(and wrapped in [ ]) You should use kebab-case for primitive properties per the Custom Element Spec. display-stepper-buttons="false"
For simple props, you should just be able to use interpolation.
React doesn't support web components natively (yet in React v18.3), so it doesn't support camelCase for Prop names- instead React use dash-case for Primitive type Props
auto-focus={true}
for complex/reference type Props(e.g. objects,arrays,etc.), but can also be used for primitive types as well
The inline properties won't work without a ref as React doesn't support complex props on web components without them. Only primitives can be passed to web components as inline props (in React)
const inputRef = useCustomElementRef({}, {label: 'Prop Format 3 (Complex/Reference Types)', autofocus:true} );
(or) return( <fluid-form ref={useCustomElementRef({ valueChanged: (event) => handleValueChanged(event.detail) },{ config: formConfig, })}/>
FLUID React utils package, which provide wrappers around the runtime components to make it easier for React development.
in React, circled props won't work