VsCode React Boilerplate Code Generator
This extension aims to help developer get pre-backed boiler plate code following best practices and bring consistency into project. It generates opinionated, batteries-included code snippets.
Features
Since it is just the beginning of this extension, it has only 1 feature at the moment:
- Generate React Redux Component
Open command pallete CMD+SHIFT+P
and select Generate React Redux Component
. You would need to bind the slice inside root reducer after code generation, like below:
import { combineReducers } from 'redux';
import { name as sliceName, reducer as sliceNameReducer } from '../components/Counter/redux/slice';
const createRootReducer = () => {
return combineReducers({
...
[sliceName]: sliceNameReducer,
})
}
export default createRootReducer
Full generated code example: Counter Component
I will be adding short animation on how this extension works, shortly.
Requirements
This extensions helps best if you are using following packages in your react project:
@reduxjs/toolkit
reselect
react-redux
prop-types
lodash
- React functional components
Release Notes
1.2.2
Initial release of this extension consisting of Generate React Redux Component
Template
Enjoy!