![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/doorofchoice/pagination
It's can generate any href you want, and it depends on beego/orm
go get github.com/doorOfChoice/pagination
//o: need a query seter, such as o.QueryTable("user")
//tp: the interface to get datas
//params[0], count of show href link in paginatior DEFAULT:5
//params[1], count of show data in per page DEFAULT 15
func NewPaginator(r *http.Request, o orm.QuerySeter, tp interface{}, params ...int64) *Paginator
userController.go
// If I has a model is User
type User struct{
Id int `orm:"auto;pk"`
Name string
}
func (c *UserController) GetAllUsers() {
var users []*User
o := orm.NewOrm()
//generate a paginator
paginator := pagination.NewPaginator(
c.Ctx.Request,
o.Query("user").Filter("id" > 5),
&users,
15,
15,
)
c.Data["P"] = paginator
c.Data["Users"] = users
c.TplName = "user.tpl"
}
There are some params, you can use it in template
type Paginator struct {
PageLinkPrev string
PageLinkNext string
PageLinkLast string
PageLinkFirst string
PerValue int64
MaxValue int64 //sum of data in the table
CurrentValue int64 //how many data in current page
CurrentPage int64
MaxPage int64
BasePath string
Links []Link //generated links
}
type Link struct {
Id int64 //which page
IsCurrent bool //is current page
Href string//the href
}
MIT
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.