📜  useSearchParams - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:32.332000             🧑  作者: Mango

代码示例3
// React Router v6: hook returns obj w key/values of params from URL
import { Routes, Route, useParams } from 'react-router-dom';

function Profile() {
  // 'https://www.url.com/users/:userId'
  let { userId } = useParams();
  // user profile...
}

function App() {
  return (
    
      
        } />
        
      
    
  );
}