Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactJS Functional Components #5

Open
MauricioAires opened this issue Feb 12, 2023 · 0 comments
Open

ReactJS Functional Components #5

MauricioAires opened this issue Feb 12, 2023 · 0 comments

Comments

@MauricioAires
Copy link
Owner

Functional components are some of the more common components that will come across while working in React. These are simply JavaScript functions. We can create a functional component to React by writing a JavaScript function. These functions may or may not receive data as parameters. In the functional Components, the return value is the JSX code to render to the DOM tree.
Example: Program to demonstrate the creation of functional components.

Filepath- src/index.js: Open your React project directory and edit the index.js file from src folder:

Different ways of calling the functional component:

We can call the functions in java script in other ways as following:

Calling the function by using name of the function followed by the Parentheses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant