It doesn’t make much sense to do this because Angular has an MVC structure and React doesn’t, the most you can do is create two components. One that only renders Components from props and another that takes care of the state and functions
Example in React
Example in React Native
function SomenteJSX(props) {
return <View>{props.oQueVoceQuiser}</View>;
}
class SomenteStateProps extends React.Component {
state = {
oQueVoceQuiser: "hey"
};
algumaFuncao = () => console.log("oi");
render() {
return (
<SomenteJSX
algumaFuncao={this.state.algumaFuncao}
oQueVoceQuiser={this.state.oQueVoceQuiser}
/>
);
}
}
But it will still be difficult to remove all JSX from the component.
Trying to turn React into a MVC structure is not recommended. What I advise is to always separate the css file from the component.
Hmm, got it. Vlw and brother.
– Bruno Eduardo