menu

Webcodesk

Here you can chat about Webcodesk, ask or answer questions.

Channels
Team

Compatibility with functional React components

February 26, 2020 at 11:23pm

Compatibility with functional React components

February 26, 2020 at 11:23pm
Is there support for function react components? Upon saving a react function component if there is a prop being called as a function it deletes the file

February 27, 2020 at 5:25am
Yes, you can create functional component. Use the following pattern:
const ComponentName = (props) => {
return ( <div></div> );
};
ComponentName.propTypes = {
someOption: PropTypes.string,
someFunction: PropTypes.func,
}
ComponentName.defaultProps = {
someOption: "Test"
}
export default ComponentName;
Edited
  • reply
  • like

February 28, 2020 at 1:00am
awesome thank you, this app is amazing btw
  • reply
  • like
Im attempting to hack it apart to add in aws amplify and infrastructure functionality ill let ya know how it goes
  • reply
  • like

February 28, 2020 at 2:14pm
Tank you. I appreciate your efforts.
  • reply
  • like