About 159 results
Open links in new tab
  1. Passing Props to a Component – React

    Props are the information that you pass to a JSX tag. For example, className, src, alt, width, and height are some of the props you can pass to an <img>:

  2. Using TypeScript – React - code++

    You can see an example of both React.ReactNode and React.ReactElement with the type-checker in this TypeScript playground. Style Props . When using inline styles in React, you …

  3. Passing Data Deeply with Context – React - code++

    Usually, you will pass information from a parent component to a child component via props. But passing props can become verbose and inconvenient if you have to pass them through many …

  4. Children – React

    A prop like renderContent is called a render prop because it is a prop that specifies how to render a piece of the user interface. However, there is nothing special about it: it is a regular prop …

  5. createElement – React

    React will create an element with props matching the props you have passed. Note that ref and key from your props object are special and will not be available as element.props.ref and …

  6. Sharing State Between Components – React

    Sometimes, you want the state of two components to always change together. To do it, remove state from both of them, move it to their closest common parent, and then pass it down to …

  7. Your First Component – React

    React lets you create components, reusable UI elements for your app. In a React app, every piece of UI is a component. React components are regular JavaScript functions except: Their …

  8. forwardRef – React

    forwardRef returns a React component that you can render in JSX. Unlike React components defined as plain functions, the component returned by forwardRef is able to take a ref prop.

  9. Component – React

    constructor(props) The constructor runs before your class component mounts (gets added to the screen). Typically, a constructor is only used for two purposes in React. It lets you declare …

  10. <form> – React

    See more examples below. Props <form> supports all common element props. action: a URL or function. When a URL is passed to action the form will behave like the HTML form component. …

Refresh