Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@lessondesk/react-table-context
Advanced tools
Flexible Table Provider & Consumer
import React from 'react'
import ReactDOM from 'react-dom'
import createTableContext from './react-table-context'
const Table = () => {
const [Provider, Consumer] = createTableContext(async args => {
console.log('args', args)
const response = await fetch('https://jsonplaceholder.typicode.com/todos')
const json = await response.json()
return {
meta: {
count: json.length
},
data: json
}
})
return <Provider>
<div>
<h1>Example Table</h1>
<Consumer>
{({
page, // 0
pageSize, // 10
firstPage, // true
isLoading, // false
isEmpty, // false
data, // Array[100]
meta, // Object
error, // null
filters, // Object
unappliedFilters, // Object
sorting, // Object
pageData, // Array[10]
selected, // Array[0]
search, //
setSearch, // function () {}
setPage, // function () {}
setSorting, // function () {}
setPageSize, // function () {}
refresh, // function () {}
setSelected, // function () {}
toggleSelectAll, // function () {}
setFilters, // function () {}
setUnappliedFilters, // function () {}
applyFilters // function () {}
}) => {
console.log('data', data)
return <table>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Completed</th>
</tr>
</thead>
<tbody>
{pageData.map(({ id, title, completed }) => {
return <tr key={id}>
<td>{id}</td>
<td>{title}</td>
<td>{completed ? 'Yes' : 'Nope'}</td>
</tr>
})}
</tbody>
</table>
}}
</Consumer>
</div>
</Provider>
}
function App () {
return (
<div className='App'>
<Table />
</div>
)
}
const rootElement = document.getElementById('root')
ReactDOM.render(<App />, rootElement)
This project uses node and npm.
$ npm install @lessondesk/react-table-context
$ # OR
$ yarn add @lessondesk/react-table-context
git checkout -b my-new-feature
git commit -am "Add some feature"
git push origin my-new-feature
MIT
FAQs
Flexible Table Provider & Consumer
We found that @lessondesk/react-table-context demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.