Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div id='root'></div>




                const { HashRouter, Route, Link, Routes, useLocation, Outlet, useParams } = ReactRouterDOM;

const students = {
  1: 'Иванов',
  2: 'Петров',
  3: 'Сидоров'

const Students = () => (
    <h1>Страница студентов</h1>
        ([id, name]) => <li key={id}><Link to={id}>{name}</Link></li>
      <Route path=":id" element={<Student />} />

const Student = () => {
  const {id} = useParams();
  return <div>Студент {students[id]}</div>

const About = () => (
    Страница о проекте.
    Кафедра ИУ5
    <Outlet />

const AboutInner = () => <div>Внутри About</div>

const Home = () => (
    <h1>Приветствуем на сайте ИУ5</h1>

const Main = () => (
      <Route exact path='/' element={<Home />}/>
      <Route path='/students/*' element={<Students/>}/>
      <Route path='/about' element={<About />}>
        <Route path="inner" element={<AboutInner />} />

const Header = () => (
        <li><Link to='/'>Домой</Link></li>
        <li><Link to='/students'>Студенты</Link></li>
        <li><Link to='/about'>О проекте</Link></li>
        <li><Link to='/about/inner'>О проекте внутренняя</Link></li>

const App = () => {
  const {pathname} = useLocation();
  return (
      <Header />
      Текущий урл: {pathname}
      <Main />

    <App />
), document.getElementById('root'))