Files
codeql/javascript/ql/test/library-tests/frameworks/ReactJS/es5.js
2025-06-23 16:03:33 +02:00

23 lines
597 B
JavaScript

var Hello = React.createClass({
displayName: 'Hello',
render: function() {
return <div>Hello {this.props.name}</div>; // $ threatModelSource=view-component-input
},
getDefaultProps: function() {
return {
name: 'world' // $ getACandidatePropsValue
};
}
}); // $ reactComponent
Hello.info = function() {
return "Nothing to see here.";
};
var createReactClass = require('create-react-class');
var Greeting = createReactClass({
render: function() {
return <h1>Hello, {this.props.name}</h1>; // $ threatModelSource=view-component-input
}
}); // $ reactComponent