We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
export const CustomFormFrame=(props:any)=> { const [enable,setEnable]=useState(true) const formData = useSelector((state:any) => { return state.formData}); const dispatch = useDispatch(); const updateVal=(k:string,v:any)=>{ let data=Object.assign({},formData); data[`${k}`]=v; dispatch({ type: 'CHANGE_DATA', payload: {formData:data} }); } const test=()=>{ debugger console.log('test ',formData) if(formData.select){ // return <CustomFormSelect k={'select'} v={'running'} updateVal={updateVal}/> return<div>44444</div> }else{ return <div>12312</div> } } return ( <div className="App"> <Editor resolver={{ CustomForm,Button,CustomFormInput,CustomFormSelect }} enabled={enable} > <Frame> <Element is={CustomForm} canvas> <CustomFormInput k={'input'} v={111} updateVal={updateVal}/> <hr/> <div>{JSON.stringify(formData)}</div> {/*<CustomFormSelect k={'select'} v={'running'} updateVal={updateVal}/>*/} {test()} <h1>Hello CodeSandbox</h1> <Button /> <h2>Start editing to see some magic happen!</h2> </Element> </Frame> {/*<Layers />*/} </Editor> <div>{JSON.stringify(formData)}</div> {test()} </div> ); }
"@craftjs/core": "^0.2.0-beta.12", "react": "^18.2.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", "react-dom": "^18.2.0", "react-redux": "^8.1.2", "react-scripts": "5.0.1", "redux": "^4.2.1", "typescript": "^4.7.4",
node:18.3.0 npm 8.11.0
mac os
The text was updated successfully, but these errors were encountered:
@prevwong
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Your environment
node:18.3.0
npm 8.11.0
mac os
The text was updated successfully, but these errors were encountered: