Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 478 Bytes

useParams.md

File metadata and controls

21 lines (18 loc) · 478 Bytes

useParams

Dùng để truy xuất url params hiện tại trên trình duyệt

import React from "react";

import { useParams } from "react-router-dom";

export default () => {
  // The <Route> that rendered this component has a
  // path of `/topics/:topicId`. The `:topicId` portion
  // of the URL indicates a placeholder that we can
  // get from `useParams()`.
  let { topicId } = useParams();

  return (
    <div>
      <h3>{topicId}</h3>
    </div>
  );
};