MCPcopy Create free account
hub / github.com/byte-fe/react-model / render

Method render

src/index.tsx:412–437  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

410) => (Component: typeof React.Component | typeof PureComponent) =>
411 class P extends PureComponent<any> {
412 render() {
413 const { state: prevState = {}, actions: prevActions = {} } = this.props
414 return (
415 <Consumer>
416 {(models) => {
417 const { [`${modelName}`]: state } = models as any
418 const actions = Global.Actions[modelName]
419 return (
420 <Component
421 {...this.props}
422 state={{
423 ...prevState,
424 ...(mapState ? mapState(state) : state)
425 }}
426 actions={{
427 ...prevActions,
428 ...(mapActions
429 ? mapActions(consumerActions(actions, { modelName }))
430 : consumerActions(actions, { modelName }))
431 }}
432 />
433 )
434 }}
435 </Consumer>
436 )
437 }
438 }
439
440export {

Callers

nothing calls this directly

Calls 1

consumerActionsFunction · 0.90

Tested by

no test coverage detected