create-packer 1.17.5 → 1.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.17.5",
3
+ "version": "1.17.6",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -13,8 +13,8 @@ import { createRoot } from 'react-dom/client'
13
13
  const instanceMap: Record<string, any> = {}
14
14
 
15
15
  interface refsType<P> {
16
- setProps: (newProps?: P) => void
17
- updateProps: (newProps?: Partial<P>) => void
16
+ $setProps: (newProps?: P) => void
17
+ $updateProps: (newProps?: Partial<P>) => void
18
18
  }
19
19
 
20
20
  export async function create<P extends Record<string, any>, Refs extends Record<string, any>>(
@@ -33,10 +33,10 @@ export async function create<P extends Record<string, any>, Refs extends Record<
33
33
 
34
34
  useImperativeHandle(refs, () => {
35
35
  return {
36
- setProps: newProps => {
36
+ $setProps: newProps => {
37
37
  setState(() => newProps)
38
38
  },
39
- updateProps: newProps => {
39
+ $updateProps: newProps => {
40
40
  if (newProps) {
41
41
  setState(state => ({ ...state, ...props }))
42
42
  }
@@ -57,7 +57,7 @@ export async function create<P extends Record<string, any>, Refs extends Record<
57
57
  )
58
58
  })
59
59
  }
60
- $instance.setProps(props)
60
+ $instance.$setProps(props)
61
61
  return $instance
62
62
  }
63
63