MCPcopy Create free account
hub / github.com/dapi-labs/react-nice-avatar / genCodeString

Method genCodeString

demo/src/App/AvatarEditor/index.tsx:69–79  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

67 }
68
69 genCodeString (config) {
70 const ignoreAttr = ['id']
71 const myConfig = Object.keys(config)
72 .filter(key => !ignoreAttr.includes(key))
73 .reduce((acc, key) => ({ ...acc, [key]: config[key] }), {})
74 return "const config = " +
75 JSON.stringify(myConfig, null, 2) +
76 "\n" +
77 "const myConfig = genConfig(config)\n" +
78 "<NiceAvatar style={{ width: '5rem', height: '5rem' }} {...myConfig} />"
79 }
80
81 render () {
82 const { config, shape, download } = this.props

Callers 1

renderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected