generator-rrf
v1.0.0
Published
Yeoman React Router Framework generators
Maintainers
Readme
Yeoman React Router Framework Generators
A generator for creating React Router routes using Yeoman.
Installation
Install as Project Dependency
npm install --save-dev generator-rrfInstall globally
npm install -g generator-rrfUsage
Command-Line Usage
Generate a route without prompt (uses default name)
yo rrf:route MyRouteGenerate a route with prompts
yo rrf:routeNpm Script Usage
# Add to your package.json scripts (optional):
{
"scripts": {
"g-rrf": "yo rrf:route"
}
}
# Then run:
npm run g-rrf:route MyRouteProject Structure
This generator creates files in your app/routes/ directory:
your-project/
├── app/
│ └── routes/
│ └── YourRouteName.tsx # Generated fileHow it Works
- The generator prompts you (or accepts command-line input) for the route name
- It uses EJS templating to generate a basic React component
- The file is placed in
app/routes/folder
Generated Component
import React from 'react';
export default function YourRouteName() {
return (
<div>
<h1>YourRouteName Route Page</h1>
</div>
);
}License
ISC
