Logo

Definicja komponentu Searchbar

// src/components/Searchbar.js

import React from 'react';

class Searchbar extends React.Component {
  render() {
    return (
      <label>
        Imię
        <input type="text" />
      </label>
    );
  }
}

export default Searchbar;

Wyrenderujmy go w App

// src/App.js

import React from 'react';
// inne import
import Searchbar from './components/Searchbar';

class App extends React.Component {
  render() {
    return (
      <div className="App">
        <Searchbar />
        // reszta
      </div>
    );
  }
}

export default App;