score:1
can't see why you would need that, but you could do something like this:
window.testing_one = (params) => {
reactdom.render(
<app {...params} />,
document.getelementbyid('root')
);
};
then you can manually call testing_one({some: 'params'});
in console.
better way would be do the testing in test environment where you can do the same thing easier. see something like: https://medium.com/selleo/testing-react-components-best-practices-2f77ac302d12
Source: stackoverflow.com
Related Query
- How to Require React Components In Console
- How can I require react components from a local folder without node_modules from a globally installed node app?
- How can I prevent event bubbling in nested React components on click?
- How to import and export components using React + ES6 + webpack?
- How to render react components by using map and join?
- How to concatenate JSX components in React Native
- how to use react require syntax?
- How can I call methods on Reactjs components in the browser console or from an outside script?
- How to get values from child components in React
- In React Native how can I test my components with Shallow Rendering?
- How do I make components in React Native without using JSX?
- How to use SCSS variables into my React components
- Swiper React | How to create custom navigation/pagination components using React refs?
- How to style child components in React with CSS Modules
- How to Embed StencilJS components inside Storybook React App?
- How Center Components Using Flex in React Native?
- How to check when the react components get rendered or rerendered
- React Router with - Ant Design Sider: how to populate content section with components for relevant menu item
- How to communicate UI state changes between React components with Redux?
- How to parse a String containing HTML to React Components
- Using React Router and Webpack 2 how to require external libraries only on certain routes?
- How to use react j s components in react native app?
- React hooks: How to write variables in functional components that in class components were initialized in the constructor
- How to embed React Components in html pages
- How will React 0.14's Stateless Components offer performance improvements without shouldComponentUpdate?
- How can I dispatch from child components in React Redux?
- How to keep React components state after browser refresh
- How to handle click events on child components in React.js, is there a React "way"?
- How to create custom React Native components with child nodes
- How to sort list of React components based on different properties?
More Query from same tag
- Import a module from Node.js into a React app
- Why does my code type get a warning? "warning Missing return type on function"
- Comparing color strings in typescript
- classNames is not defined
- I am trying to log the props of a parent component in the child component
- React-Router: How to redirect Route to another url conditionally?
- redux-toolkit giving me that circular dependency issue
- How to implement 'Reset ' in reactjs
- react-query: how to get the data from useQuery in onSuccess callback?
- How should I structure/pass my data or actions in redux
- Recharts - bar chart dynamic label position
- React Redux action is being called before init
- useAsyncStorage custom hook with useState hook in React Native
- this.state is undefined inside child component
- Race condition in React; API calls, database call
- how to let component rerender during props change
- how to add Spinner while render a component on react?
- React.js: Component not rendering or showing up at all
- Refactoring code for custom date component
- Router Switch in React
- React useState with className and styled components hover out
- xAxis hides after resize in react rechart
- React, state, Why the `count` is not defined?
- Create React App fails when "Starting the development server"
- Unable to map through dynamically created array through redux
- how to secure security_access_key in react js application?
- React ES6 class method does not render into html table but outside it. Why?
- Flex overlapping 2 child flex layout class set in a row
- Merge Two Api's from JsonPlaceholder
- Set default value for RangePicker with form in Ant-Design